ch 4. the network layer from computer networking by j. kurose
DESCRIPTION
Myungchul Kim [email protected]. Ch 4. The Network Layer from Computer Networking by J. Kurose. Datagram networks Prefix match Longest prefix matching rule Forwarding tables can be modified at any time -> packets go different paths and arrive out of order. Forwarding table. 4 billion - PowerPoint PPT PresentationTRANSCRIPT
![Page 2: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/2.jpg)
2
![Page 3: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/3.jpg)
3
![Page 4: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/4.jpg)
4
Datagram networks– Prefix match – Longest prefix matching rule– Forwarding tables can be modified at any time -> packets go
different paths and arrive out of order
![Page 5: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/5.jpg)
5
Forwarding table
Destination Address Range Link Interface
11001000 00010111 00010000 00000000 through 0 11001000 00010111 00010111 11111111
11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111
11001000 00010111 00011001 00000000 through 2 11001000 00010111 00011111 11111111
otherwise 3
4 billion possible entries
![Page 6: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/6.jpg)
6
What’s inside a router
![Page 7: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/7.jpg)
7
Where does queuing occur– Packet queue can form at both the input ports and the output
ports– Packet loss – Packet scheduler at the output port must choose one packet
among those queued for transmission• First-come-first-served• Weighted fair queueing• For quality-of-service guarantees
![Page 8: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/8.jpg)
8
IP: forwarding and addressing in the Internet
![Page 9: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/9.jpg)
9
Routing algoritms
– Default router: the first-hop router– The least cost path
– Global routing algorithm: link-state (LS) algorithms– Decentralized routing algorithm: distance-vector (DV) algorithms
– Static routing algorithms vs dynamic routing
– Load-sensitive algorithms vs load-insensitive
![Page 10: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/10.jpg)
10
Hierarchical routing– Autonomous systems (ASs)– Gateway routers– Within an AS, all routers run the same intra-AS routing protocol.– The ASs run the same inter-AS routing protocol.
![Page 11: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/11.jpg)
11
Routing in the Internet
RIP (routing information protocol)– DV protocol– Hop count as a cost metric (max 15)– Routing updates every 30 seconds
![Page 12: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/12.jpg)
12
OSPF(open shortest path first)– LS protocol– Link’s state updates every 30 minutes– Advantages:
• Security: MD5• Multiple same-cost paths• Integrated support for unicast and multicast routing• Support for hierarchy within a single routing domain
![Page 13: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/13.jpg)
13
![Page 14: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/14.jpg)
14
Broadcast and Multicast Routing
Broadcast routing algorithms– N-way unicast– Uncontrolled flooding -> broadcast storm
![Page 15: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/15.jpg)
15
– Controlled flooding• Sequence-number-controlled flooding• Reverse path forwarding (RPF)
![Page 16: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/16.jpg)
16
– Spanning-tree broadcast
![Page 17: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/17.jpg)
17
Routing Algorithms (Ch5 of Computer Network by A.
Tanenbaum)
– Shortest path routing• static• simple and easy to understand.• Metric for a shortest path: distance, bandwidth,
average traffic, communication cost, mean queue length, measured delay, ….
![Page 18: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/18.jpg)
18
Dijkstra (1959):
![Page 19: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/19.jpg)
19
– Flooding• Static• Every incoming packet is sent out on every
outgoing line except the one it arrived on.• Damming the flood
• Hop counter• Keep track of which packets have been
flooded• Selective flooding: only on those lines that are
going approximately in the right direction• Flooding always chooses the shortest path.• No other algorithm can produce a shorter delay.• Overhead
![Page 20: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/20.jpg)
20
– Distance vector routing• dynamic• each router maintains a table (vector) giving the
best known distance to each destination and which line to use to get there.
• Distributed Bellman-Ford routing algorithm and the Ford-Fulkerson algorithm.
• Original ARPANET routing algorithm.• Routing Information Protocol (RIP)• one entry for each router.• Metric: hopes, queue length, delay.
![Page 21: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/21.jpg)
21
![Page 22: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/22.jpg)
22
The count-to-infinity problem– serious drawback in practice. – Reacts rapidly to good news, but leisurely to
bad news.
– why bad news travels slowly: no router ever has a value more than one higher than the minimum of all its neighbors. -> set infinity to the longest path plus 1.
![Page 23: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/23.jpg)
23
– Link state routing• demise of distance vector routing
• did not take line bandwidth into account• often took too long to converge.
• Idea behind link state routing1. discover its neighbors and learn their
network address.2. measure the delay or cost to each of its
neighbors.3. construct a packet telling all it has just
learned.4. send this packet to all other routers.5. compute the shortest path to every other
router.
![Page 24: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/24.jpg)
24
Learning about the neighbors.– Send a special HELLO packet on each
point-to-point line after a router is booted.– Send back a reply telling who it is.
![Page 25: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/25.jpg)
25
Measuring line cost– each router know the delay to each of its neighbors
by sending a special ECHO packet.– Whether or not to take the load into account when
measuring the delay.– The routing tables may oscillate wildly.
![Page 26: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/26.jpg)
26
Building link state packets
– the hard part is determining when to build them: periodically or some significant event occurs.
![Page 27: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/27.jpg)
27
Distributing the link state packets– Idea
• Use flooding to distribute the link state packets.
• Routers keep track of all the (source router, sequence) pairs they see.
• If it is new, forward on all lines except the one it arrived on.
• If a duplicate, discard.• If a sequence number lower, reject.
– A few problems• sequence numbers wrap around.• router crashes (starts again at 0)• sequence number is corrupted.
![Page 28: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/28.jpg)
28
– Solution: when the age hits zero, the information from that router is discarded. The age field is decremented by each router during the initial flooding process.
– The send flags mean that the packet must be sent on the indicated line. The acknowledgement flags mean that it must be acknowledged there.
![Page 29: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/29.jpg)
29
Computing the new routes– after accumulating a full set of link state
packets, the entire subnet graph can be constructed.
– Dijkstra’s algorithm – n routers with each of which has k
neighbors -> the memory is proportional to kn.
– IS-IS, OSPF
![Page 30: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/30.jpg)
30
– Broadcast routing send a packet to all destinations simultaneously
– Send a distinct packet to each destination– Flooding– Multidestination routing– Sink tree or spanning tree: includes all the
routers but contains no loops
![Page 31: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/31.jpg)
31
– Multicast routing• send messages to well-defined groups that are
numerically large in size but small compared to the network as a whole.
• Group management is required. Routers know which of their hosts belong to which groups.
![Page 32: Ch 4. The Network Layer from Computer Networking by J. Kurose](https://reader035.vdocument.in/reader035/viewer/2022081501/56812b25550346895d8f2848/html5/thumbnails/32.jpg)
32
Intra-AS routing: RIP and OSPF Routing Information Protocol
– Distance vector protocol– Hop count as a cost metric– Max cost of a path: 15– Every 30 seconds for RIP advertisements
Open Shortest Path First– Link state protocol– Once every 30 minutes– Adv.: security, multiple same-cost paths, integrated support
for unicast and multicast routing, and support for hierarchy within a single routing domain.
Routing in the Internet