Presentation is loading. Please wait.

Presentation is loading. Please wait.

EEC-484/584 Computer Networks

Similar presentations


Presentation on theme: "EEC-484/584 Computer Networks"— Presentation transcript:

1 EEC-484/584 Computer Networks
Lecture 10 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross’s slides for their Computer Networking book)

2 EEC-484/584: Computer Networks
Outline Distance vector routing Hierarchical routing Internet protocol Header Fragmentation 11/23/2018 EEC-484/584: Computer Networks

3 Distance Vector Routing
Also called Bellman-Ford or Ford-Fulkerson Each router maintains a table, giving best known distance to each destination and which line to use to get there Table is updated by exchanging info with neighbors Table contains one entry for each router in network with Preferred outgoing line to that destination Estimate of time or distance to that destination Once every T msec, router sends to each neighbor a list of estimated delays to each destination and receives same from those neighbors Used in ARPANET 11/23/2018 EEC-484/584: Computer Networks

4 Distance Vector Routing: How each entry is updated
d(A,X) d(A,Y) A X Z d(Y,Z) d(X,Z) At router A, for Z Compute d(A,X) + d(X,Z) and d(A,Y) + d(Y,Z), take minimum Y d(A,Z) = min {d(A,v) + d(v,Z) } where min is taken over all neighbors v of A 11/23/2018 EEC-484/584: Computer Networks

5 EEC-484/584: Computer Networks
d(x,z) = min{d(x,y) d(y,z), d(x,z) + d(z,z)} = min{2+1 , 7+0} = 3 d(x,y) = min{d(x,y) + d(y,y), d(x,z) + d(z,y)} = min{2+0 , 7+1} = 2 node x table x y z x y z from cost to cost to x y z x 2 3 from y z node y table cost to x z 1 2 7 y x y z x y from z Each node keeps track of the following info: Its own distance vector: least-cost to each of other routers Each of its neighbor’s distance vector received most recently If there is a change in distance vector, a node sends the update to all its neighbors node z table cost to x y z x ∞ ∞ ∞ from y z 7 1 time 11/23/2018 EEC-484/584: Computer Networks

6 EEC-484/584: Computer Networks
d(x,z) = min{d(x,y) d(y,z), d(x,z) + d(z,z)} = min{2+1 , 7+0} = 3 d(x,y) = min{d(x,y) + d(y,y), d(x,z) + d(z,y)} = min{2+0 , 7+1} = 2 node x table x y z x y z from cost to cost to cost to x y z x y z x x from y from y z z node y table cost to cost to cost to x z 1 2 7 y x y z x y z x y z x x x y from y from from y z z z node z table cost to cost to cost to x y z x y z x y z x x x ∞ ∞ ∞ from y from y from y z z z 7 1 time 11/23/2018 EEC-484/584: Computer Networks

7 Distance Vector Routing
Distance from A to B 12ms, to C 25ms, to D 40ms, to G 18ms Distance from J to A 8ms, to I 10ms, to H 12ms, to K 6ms Distance from J to A to G 8+18 = 26ms to I to G = 41ms to H to G 12+6=18ms to K to G 6+31=37ms 11/23/2018 EEC-484/584: Computer Networks

8 Distance Vector Routing
Good news travels fast Bad news travels slow Count to infinity problem: Takes too long to converge upon router failure × Routers’ knowledge about the cost to A 11/23/2018 EEC-484/584: Computer Networks

9 EEC-484/584: Computer Networks
Hierarchical Routing Problem: Bigger network => bigger routing table As network size increases, more router memory used to store routing table, more time to process routing tables, more bandwidth to transmit states reports Use hierarchical structure to solve the problem Regions: router knows details of how to route packets within its region, does not know internals of other regions Clusters of regions, zones of clusters, groups of zones Tradeoff: savings in memory space may result in longer path 11/23/2018 EEC-484/584: Computer Networks

10 EEC-484/584: Computer Networks
Hierarchical Routing Optimal number of levels for N routers is lnN, with elnN routing table entries per router 11/23/2018 EEC-484/584: Computer Networks

11 Collection of Subnetworks
The Internet is an interconnected collection of many networks, or Autonomous Systems (ASes) Will not study actual Internet routing protocols such as OSPF, BGP, etc. Within each AS, OSPF is used, across different ASes, BGP is used due to different concerns 11/23/2018 EEC-484/584: Computer Networks

12 The Network Layer in Internet
Host, router network layer functions: Transport layer: TCP, UDP IP protocol addressing conventions datagram format packet handling conventions Routing protocols path selection RIP, OSPF, BGP Network layer Routing Information Protocol (RIP) Open Shortest Path First (OSPF) Border Gateway Protocol (BGP) forwarding table ICMP protocol error reporting router “signaling” Link layer physical layer 11/23/2018 EEC-484/584: Computer Networks

13 IP Datagram Format How much overhead with TCP? data (variable length,
IP protocol version number 32 bits total datagram length (bytes) header length (bytes) type of service Total length ver IHL for fragmentation/ reassembly “type” of data fragment offset 16-bit identifier flgs max number remaining hops (decremented at each router) time to live header checksum protocol 32 bit source IP address Type of service field: 6 bits, after which, there are 2 reserved bits Flags field has 3 bits: first bit is reserved, second bit: DF, third bit: MF Fragmentation offset is 13 bits long 32 bit destination IP address upper layer protocol to deliver payload to Options (if any) E.g. timestamp, record route taken, specify list of routers to visit. How much overhead with TCP? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead data (variable length, typically a TCP or UDP segment) 11/23/2018 EEC-484/584: Computer Networks

14 EEC-484/584: Computer Networks
The IPv4 Header Version – 4 IHL – length of header in 32-bit words Min 5, max 15 – i.e., 60 bytes Type of service - to distinguish different classes of service To accommodate differentiated services (which class this packet belongs to) Total length – header and data  65,535 (216-1) bytes Identification – allows destination to determine which datagram a fragment belongs to 11/23/2018 EEC-484/584: Computer Networks

15 EEC-484/584: Computer Networks
The IPv4 Header Time to live – counter to limit packet lifetimes Max lifetime 255sec Packet is destroyed when counter becomes 0 Protocol – which transport layer protocols being used Header checksum – verifies header 11/23/2018 EEC-484/584: Computer Networks

16 EEC-484/584: Computer Networks
The IPv4 Header Options – security, error reporting, etc. Some of the IP options 11/23/2018 EEC-484/584: Computer Networks

17 EEC-484/584: Computer Networks
IP Fragmentation Fragmentation Flags DF – tells routers “Don’t Fragment” MF – More Fragments. All fragments except last have this set. Used as check against total length Fragment offset – where in datagram this fragment belongs All fragments (payload in the IP packet) except last must be multiples of 8 bytes The number of 8 byte blocks is called Number of Fragment Blocks (NFB) The unit of the offset is NFB Remember that when an IP packet is fragmented, each fragment still contains a full IP header, with the original source/destination IP addresses!!! 11/23/2018 EEC-484/584: Computer Networks

18 IP Fragmentation & Reassembly
in: one large datagram out: 3 smaller datagrams Network links have MTU (max.transfer size) - largest possible link-level frame. different link types, different MTUs Large IP datagram divided (“fragmented”) within net one datagram becomes several datagrams “reassembled” only at final destination IP header bits used to identify, order related fragments reassembly 11/23/2018 EEC-484/584: Computer Networks

19 IP Fragmentation and Reassembly
ID =x offset =0 MF length =4000 Example 4000 byte datagram MTU = 1500 bytes One large datagram becomes several smaller datagrams ID =x offset =0 MF =1 length =1500 1480 bytes in data field ID =x offset =185 MF =1 length =1500 offset = 1480/8 ID =x offset =370 MF =0 length =1040 Fragment should be as large as possible 11/23/2018 EEC-484/584: Computer Networks

20 Distance Vector Routing: Exercise
Consider the subnet shown below. Distance vector routing is used, and the following vectors have just come in to router C: from B: (5, 0, 8, 12, 6, 2); from D: (16, 12, 6, 0, 9, 10); and from E: (7, 6, 3, 9, 0, 4). The measured delays to B, D, and E, are 6, 3, and 5, respectively. What is C's new routing table? Give both the outgoing line to use and the expected delay. Postpone the discussion on the solution to link state to discussion session? 11/23/2018 EEC-484/584: Computer Networks

21 Exercise: IP Fragmentation
Suppose that host A is connected to a router R 1, R 1 is connected to another router, R 2, and R 2 is connected to host B. Suppose that a TCP message that contains 900 bytes of data and 20 bytes of TCP header is passed to the IP code at host A for delivery to B. Show the Total length, Identification, DF, MF, and Fragment offset fields of the IP header in each packet transmitted over the three links. Assume that link A-R1 can support a maximum frame size of 1024 bytes including a 14-byte frame header, link R1-R2 can support a maximum frame size of 512 bytes, including an 8-byte frame header, and link R2-B can support a maximum frame size of 512 bytes including a 12-byte frame header. 11/23/2018 EEC-484/584: Computer Networks


Download ppt "EEC-484/584 Computer Networks"

Similar presentations


Ads by Google