Download Computer Network Final Exam 2005

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Internet protocol suite wikipedia , lookup

Zigbee wikipedia , lookup

AppleTalk wikipedia , lookup

Backpressure routing wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

Network tap wikipedia , lookup

Multiprotocol Label Switching wikipedia , lookup

I²C wikipedia , lookup

IEEE 802.11 wikipedia , lookup

Computer network wikipedia , lookup

Zero-configuration networking wikipedia , lookup

List of wireless community networks by region wikipedia , lookup

IEEE 802.1aq wikipedia , lookup

Airborne Networking wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

CAN bus wikipedia , lookup

IEEE 1355 wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

UniPro protocol stack wikipedia , lookup

Routing wikipedia , lookup

Routing in delay-tolerant networking wikipedia , lookup

Transcript
Computer Network Final Exam 2005 answer
1. What are the differences between routing and forwarding? Please briefly explain
each of them. (5%)
Ans:
forwarding: move packets from router’s input to appropriate router output.
routing: determine route taken by packets from source to destination.
2. During normal IP packet forwarding at a router, which the following packet fields are
updated? (2%)
Ans:
(c)TTL
(d)checksum
3. Routing Algorithm
Consider the network topology shown below. The topology consists of multiple
routers interconnected by links. Each link has a static cost associated with it which
represents the cost of sending data over that link.
x
1
2
3
m
1
y
5
7
n
2
u
1
10
3
z
2
s
a. Please use Dijkstra’s shortest-path algorithm to compute the shortest path
from y to all network nodes. Show your work by computing a table similar
to tables below.
Ans:
D(x)
D(m),
D(z),
D(n),
D(s),
D(u),
,p(x
p(m)
p(z)
p(n)
p(s)
p(u)
N’
)
y
3,y
ym
2,m
10,y
Inf
inf
Inf
6,m
3,m
Inf
inf
ymx
6,m
3,m
inf
Inf
ymxn
5,n
4,n
10,n
ymxns
5,n
ymxnsz
5,n
ymxnszu
1,y
7,s
b. Consider the Distance Vector Algorithm. When the link cost between x and
y changes. For the following figure (a), please show why good news (cost
change from 3 to 1) travel fast, and for figure (b), please show why bad
news (cost change from 3 to 90) travel slowly. Please describe how the
routing table of x changes with time. (10%)
1
90
3
x
y
80
3
1
z
Fig (a): Good news travel fast
x
y
80
1
z
Fig (b): Bad news travel slowly
4. Compare and contrast the advertisements used by RIP and OSPF.(5%)
Ans:
OSPF uses Link state algorithm .A router periodically broadcasts routing
information to all other routers in the AS, not just to its neighboring routers. This
routing information sent by a router has one entry for each of the router’s neighbors;
the entry gives the distance from the router to the neighbor. A RIP advertisement sent
by a router contains information about all the networks in the AS, although this
information is only sent to its neighboring routers. Use Distance Vector Algorithm.
5. What is the difference between Link-Layer and Transport-Layer reliable data
transfers? (Hint: With the TCP reliable data transfer, why does the underlying
link layer support data transmission reliability?) (5%)
Ans: Similar to transport –layer reliable delivery service, a link layer reliable
delivery service is achieved with acknowledgements and retransmissions. …A link
layer reliable delivery service is often used for links that are prone to high error rates,
such as a wireless link, with the goal of correcting an error locally—on the link where
the error occurs—rather than forcing an end-to-end retransmission of the data by
transport or application-layer protocol. (課本 P.421)
6. Suppose that in pure ALOHA, there are N active nodes with many frames to send.
Each node transmits in a slot with probability p. Find the maximum efficiency of
pure ALOHA. Please derive the maximum efficiency STEP-BY-STEP. (10%)
Ans:
Pure ALOHA
 Unslotted Aloha: simpler, no synchronization
 When frame first arrives, transmit immediately
 Collision probability increases:
Frame sent at t0 collides with other frames sent in [t0-1,t0+1]
P(success by given node) = P(node transmits) .
P(no other node transmits in [p0-1,p0] .
P(no other node transmits in [p0-1,p0] =p . (1-p)N-1 . (1-p)N-1=
E ( p)  Np(1  p) 2( N 1)
choosing optimum p and then letting n -> infty= 1/(2e)
E ( p)  Np(1  p) 2( N 1) (6%)
E ' ( p)  N (1  p) 2( N 2)  Np2( N  1)(1  p) 2( N 3)
 N (1  p) 2( N 3) ((1  p)  p2( N  1))
E ' ( p )  0  p* 
E ( p*) 
lim E ( p*) 
N 
1
2N  1
N
1
(1 
) 2 ( N 1)
2N  1
2N  1
1 1 1
 
(4%)
2 e 2e
7. Why Ethernet chooses CSMA/CD as its protocol instead of others. Please list its
advantages (4%) and compare it with slotted ALOHA, pure ALOHA and
CSMA.(6%)共(10%)
Ans:
CSMA/CD (Collision Detection)

collisions detected within short time


colliding transmissions aborted, reducing channel wastage
collision detection:
 easy in wired LANs: measure signal strengths, compare transmitted,
received signals
human analogy: the polite conversationalist

ALOHA
 unslotted Aloha: simpler, no synchronization
 when frame first arrives transmit immediately
 collision probability increases:
frame sent at t0 collides with other frames sent in [t0-1,t0+1]
***maximum efficiency: 1
2e
and even worse…
S-ALOHA
Pros
 single active node can continuously transmit at full rate of channel(1%)
 highly decentralized: only slots in nodes need to be in sync
 simple
Cons
 collisions, wasting slots
 idle slots

clock synchronization
***efficiency: 1 (1%)
e
CSMA Carrier Sense Multiple Access (2%)
If channel sensed idle: transmit entire frame
If channel sensed busy, defer transmission
Human analogy: don’t interrupt others!
 colliding transmissions aborted, reducing channel wastage (1%)
 The same with CSMA/CD but only detection but when collision happens, it can
not handle it.
8. Hubs Switches and Routers
a. Please briefly describe the sameness and differences between switches and
routers.(5%)
Ans:
Sameness:They are both store-and-forward devices.
Differences:But routers are network layer devices (examine network layer headers)
and switches are link layer devices.
Routers maintain routing tables, implement routing algorithms
Switches maintain switch tables, implement filtering, learning algorithms
hubs
routers
switches
traffic
isolation
no
yes
yes
plug & play
yes
no
yes
optimal
routing
cut
through
no
yes
no
yes
no
yes
b. What is a collision domain? (Please associated it with switches and hubs). (5%)
Ans:
A collision will happen if node receives two or more signals at the same time.
Between the hub and the hosts that connect to the hub. In a single segment, the
maximum node and its hub is 100 meters. All of the LAN segments belong to the
same collision domain. Whenever two or more nodes on the LAN segments
transmit at the same time, there will be a collision. All of the transmitting nodes
will enter exponential backoff. Individual segment collision domains become one
large collision domain and bandwidth can not be aggregated
Switch installation breaks subnet into LAN segments
 switch filters packets:
 same-LAN-segment frames not usually forwarded onto other LAN
segments
***segments become separate collision domains
9. Use module 2 arithmetic to compute the CRC code for message 101101110011
with the generator 10011.
Ans:
CRC code:1011
10. If a host was shut down and replaced its network interface card, it will cause the
inconsistency of ARP caches in the other hosts in the same LAN. How can you
solve it?Please describe the details. (5%)
Ans:
ARP:Address Resolution Protocol

is “plug-and-play”:

Nodes create their ARP tables without intervention from net
administrator.
 Each IP node (Host, Router) on LAN has ARP table
ARP Table: IP/MAC address mappings for some LAN nodes:
< IP address; MAC address; TTL>
 TTL (Time To Live): time after which address mapping will be forgotten
(typically 20 min)
Each adapter on LAN has unique LAN address and A caches (saves)
IP-to-MAC address pair in its ARP table until information becomes old
(times out)
 soft state: information that times out (goes away) unless refreshed
The host 重新連上 network 後,向所有人發出 broadcast 的 ARP packet,include
IP/MAC address 的對應,other host in the same Len 可將 ARP tables 中的值改掉;
等 other host’s ARP table TTL timeout 後,重新對 host 發出 query 詢問 IP/MAC
address packet,藉以得到新的值。
11. What’s the main deference between MAC flat address and IP hierarchical
address?(3%)
Ans:
@MAC flat address ➜ portability
Can move LAN card from one LAN to another
@IP hierarchical address NOT portable
Depends on IP subnet to which node is attached
12. Please list the characteristics of wireless link? (5%)
Ans:課本 P.508

Decreased signal strength: radio signal attenuates as it propagates
through matter (path loss)
距離一長能量減弱

Interference from other sources: standardized wireless network
frequencies (e.g., 2.4 GHz) shared by other devices (e.g., phone);
devices (motors) interfere as well
和其它裝置一起 share 頻寬

Multipath propagation: radio signal reflects off objects ground,
arriving at destination at slightly different times
會受地面其它物品影響導致抵達時間延遲
 mobile portable 移動方便
13. Please compare CSMA/CA with CSMA/CD. Why IEEE 802.11 uses CSMA/CA
instead of CSMA/CD? (10%)
Ans:
IEEE 802.11 MAC Protocol: CSMA/CA
Avoid collisions: 2+ nodes transmitting at same time
802.11: CSMA - sense before transmitting, don’t collide with ongoing
transmission by other node
802.11: no collision detection!
 difficult to receive (sense collisions) when transmitting due to weak
received signals (fading)
 can’t sense all collisions in any case: hidden terminal, fading
 goal: avoid collisions: CSMA/C(ollision)A(voidance)
802.11 sender
1. if sense channel idle for DIFS then
transmit entire frame (no CD)
2 .if sense channel busy then
start random backoff time
timer counts down while channel idle
transmit when timer expires
if no ACK, increase random backoff interval, repeat 2
802.11 receiver
- if frame received OK
return ACK after SIFS (ACK needed due to hidden terminal problem)
Avoiding collisions (more)
idea: allow sender to “reserve” channel rather than random access of data frames:
avoid collisions of long data frames
 sender first transmits small request-to-send (RTS) packets to BS using
CSMA
 RTSs may still collide with each other (but they’re short)


BS broadcasts clear-to-send CTS in response to RTS
RTS heard by all nodes
*sender transmits data frame
*other stations defer transmissions
Avoid data frame collisions completely
using small reservation packets!
Collision Avoidance: RTS-CTS exchange
CSMA/CD 和 CSMA/CA 相同處在於,它們均會做 sensing,如果 sense idle 才會
送資料,否則就等待或停止。不同之處在於:CSMA/CD 做了 collision detection
讓資料傳遞時即偵測,若有 collision 立即中止,CSMA/CA 則不做 detection 而
是做 collision avoidance,在 sense 到 idle 後,會先進入 random backoff time 以避
免 collision 的發生,一旦可傳資料了就傳所有的 data,傳完之後回覆一個 ack,
以確定真的有收到。
802.11 使用 CSMA/CA 的原因在於 wireless 環境的限制,在無線網路中無法一
邊傳訊息一邊接收訊息且 collision is hard to detect,因為有 signal fading and
hidden terminal problem,因此不適用 CSMA/CD。
14. Please compare mobility support via Direct Routing with that via Indirect
Routing. (5%)
Ans:
Let end-systems handle it:
indirect routing: communication from correspondent to mobile goes
through home agent, then forwarded to remote
direct routing: correspondent gets foreign address of mobile, sends
directly to mobile
Indirect routing
Mobile uses two addresses:
 permanent address: used by correspondent (hence mobile location is
transparent to correspondent)
 care-of-address: used by home agent to forward datagrams to mobile
Foreign agent functions may be done by mobile itself
Triangle routing: correspondent-home-network-mobile
 inefficient when correspondent, mobile are in same network
Suppose mobile user moves to another network
 registers with new foreign agent
 new foreign agent registers with home agent
 home agent update care-of-address for mobile
 packets continue to be forwarded to mobile (but with new
care-of-address)
mobility, changing foreign networks transparent: on going connections can be
maintained!
Direct routing
Overcome triangle routing problem
 non-transparent to correspondent: correspondent must get care-of-address
from home agent
 If mobile changes visited network
Accommodating mobility with direct routing
 anchor foreign agent: FA in first visited network
 data always routed first to anchor FA
 when mobile moves: new FA arranges to have data forwarded from old FA
(chaining)