You are on page 1of 9

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 routers 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 3 y 10 z 2 s 1 5 1 m 2

2 n 1 3 7 u

a. Please use Dijkstras 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 N D(x) D(m), D(z), D(n), D(s), D(u),p ,p(x p(m) p(z) p(n) p(s) (u) ) y 3,y 1,y 10,y Inf inf Inf ym 2,m 6,m 3,m Inf inf ymx 6,m 3,m inf Inf ymxn 5,n 4,n 10,n ymxns 5,n 7,s ymxnsz 5,n ymxnszu 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 3 x y 1 z x 90 3 y 1 z

80

80

Fig (a): Good news travel fast

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 routers 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 locallyon the link where the error occursrather 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 ) Np 2( N 1)(1 p ) 2 ( N 3) = N (1 p ) 2 ( N 3) ((1 p ) p 2( N 1)) E ' ( p ) = 0 p* = E ( p*) = 1 2N 1

N 1 (1 ) 2 ( N 1) 2N 1 2N 1

lim E ( p*) =

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 e (1%) CSMA Carrier Sense Multiple Access (2%) If channel sensed idle: transmit entire frame If channel sensed busy, defer transmission Human analogy: dont 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 SamenessThey are both store-and-forward devices. DifferencesBut 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 traffic isolation plug & play optimal routing cut through no yes no yes routers yes no yes no switches yes 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 code1011 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 itPlease describe the details. (5%) Ans ARPAddress 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-toMAC 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 packetinclude IP/MAC address other host in the same Len ARP tables other hosts ARP table TTL timeout host query IP/MAC address packet 11. Whats 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, dont 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) cant 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 theyre 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-ofaddress) 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)

You might also like