Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Layer5-1 2016 session 1 TELE3118: Network Technologies Week 5: Network Layer Forwarding, Features Some slides have been taken from: r Computer.

Similar presentations


Presentation on theme: "Network Layer5-1 2016 session 1 TELE3118: Network Technologies Week 5: Network Layer Forwarding, Features Some slides have been taken from: r Computer."— Presentation transcript:

1 Network Layer5-1 2016 session 1 TELE3118: Network Technologies Week 5: Network Layer Forwarding, Features Some slides have been taken from: r Computer Networking: A Top Down Approach Featuring the Internet, 4 th edition. Jim Kurose, Keith Ross. Addison-Wesley, July 2007. All material copyright 1996- 2004. J.F Kurose and K.W. Ross, All Rights Reserved. r Computer Networks, 4 th edition. Andrew S. Tanenbaum. Prentice-Hall, 2003.

2 Network Layer5-2 IP Forwarding r Case I: hosts in same LAN (A  B) r Case II: hosts in different LANs (A  E) A note on terminology: Switch (bridge) vs. Router m Hardware vs. software? m layer-2 vs. layer-3? 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E IP datagram: misc fields source IP addr dest IP addr data

3 Network Layer5-3 Case I: hosts in same LAN Starting at A, dest. B: r look up dest-IP in routing table r dest is in LAN on interface 223.1.1.1 r send datagram directly to B in Ethernet frame r how to determine B’s Ethernet MAC address? routing table at A DestMaskNext-hop 223.1.1.024L: 223.1.1.1 0.0.0.00223.1.1.4 B’s MAC addr A’s MAC addr A’s IP addr B’s IP addr IP payload datagram frame frame source, dest address datagram source, dest address misc fields 223.1.1.1223.1.1.3 data 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E

4 Network Layer5-4 ARP: Address Resolution Protocol r Each IP node (Host, Router) on LAN has ARP table r ARP Table: IP/MAC address mappings for same LAN nodes m TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min)

5 Network Layer5-5 ARP protocol r A wants to send datagram to B, and A knows B’s IP address. r Suppose B’s MAC address is not in A’s ARP table. r A broadcasts ARP query packet, containing B's IP address m all machines on LAN receive ARP query r B receives ARP packet, replies to A with its (B's) MAC address m frame sent to A’s MAC address (unicast) r A caches (saves) IP-to- MAC address pair in its ARP table until information becomes old (times out) m soft state: information that times out (goes away) unless refreshed r ARP is “plug-and-play”: m nodes create their ARP tables without intervention from net administrator

6 Network Layer5-6 Case II: hosts in different LANs Starting at A, dest. E: r look up network address of E in routing table r E on different network m A, E not directly attached r routing table: next hop router to E is 223.1.1.4 r link layer sends datagram to router 223.1.1.4 in Ethernet frame (ARP) r datagram arrives at 223.1.1.4 r continued….. misc fields 223.1.1.1223.1.2.2 data routing table at A DestMaskNext-hop 223.1.1.024L: 223.1.1.1 0.0.0.00223.1.1.4 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E

7 Network Layer5-7 Case II (contd.) Arriving at 223.1.4, destined for 223.1.2.2 r look up network address of E in router’s routing table r E on same network as router’s interface 223.1.2.9 m router, E directly attached r link layer sends datagram to 223.1.2.2 in Ethernet frame via interface 223.1.2.9 (ARP) r datagram arrives at 223.1.2.2!!! (hooray!) misc fields 223.1.1.1223.1.2.2 data routing table in router 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E DestMaskNext-hop 223.1.1.024L: 223.1.1.4 223.1.2.024L: 223.1.2.9 223.1.3.024L: 223.1.3.27

8 Network Layer5-8 Packet walk-through A (111.111.111.111)  B (222.222.222.222) A R B Each node (host/router) has r Route table: dest/mask  next-hop r ARP table: LAN IP addr  MAC address

9 Network Layer5-9 r A creates datagram with source A, destination B r A uses ARP to get R’s MAC address for 111.111.111.110 r A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram r A’s data link layer sends frame r R’s data link layer receives frame r R removes IP datagram from Ethernet frame, sees its destined to B r R uses ARP to get B’s physical layer address r R creates frame containing A-to-B IP datagram sends to B r B receives the frame and extracts IP datagram A R B

10 Network Layer5-10 To switch or route? vlan 100 vlan 200 1 2 3 4 sMAC dMAC sIP dIP ----Data---- ?? Assume unicast traffic r Lookup dMAC in MAC-table r If (dMAC ≠ interface MAC)  switch m switch (bridge) the frame as is onto learnt port r Else frame is for upper layer (IP)  route m Lookup dest-IP in routing table (discard if no match) m Determine next hop MAC addr (ARP table) m Send datagram with new Ethernet header

11 Network Layer5-11 Switch-Router MAC table VLANMAC addressport 308-00-60-00-0910 308-00-60-00-176 300-4E-3A-02-08Self 308-00-60-00-514 7608-00-60-00-A37 7608-00-60-00-468 7608-00-60-00-1B10 201808-00-60-00-513 201808-00-60-00-9210 201800-4E-3A-02-10Self router IP interfaces on VLANs 3 and 2018 No router IP interface on VLAN 76

12 Network Layer5-12 Switch-Router routing table 0.0.0.00192.168.1.1 10.0.0.08172.20.4.1 200.23.16.020199.31.18.4 200.23.18.023172.20.4.1 10.20.0.024199.31.18.4 192.168.1.024L192.168.1.18 172.20.4.024L172.20.4.253 199.31.18.024L199.31.18.52 destination mask local next-hop LAN interfaces 172.20.4.253/24 192.168.1.18/24 199.31.18.52/24 default route

13 Network Layer5-13 Unicast forwarding algorithm Determine most specific match in routing table found one? drop packet dest on same LAN. nh-IP = dest-IP local intf? next-hop is router. nh-IP = gway-IP nh-IP in ARP table? send ARP request and wait for response get ARP response and fill in ARP table construct Ethernet header and send frame no yes no yes dest-MAC address mine? discard extract IP datagram dest-IP address mine? pass datagram data to upper layer yes no yes Send: Host receive: switch Ethernet frame dest-MAC address mine? Route IP datagram extract IP datagram dest-IP address mine? pass datagram data to upper layer yes no yes Switch/router receive:

14 Network Layer5-14 IP/Ethernet configuration 1.1.1.1/241.1.1.2/24 1.1.1.1/241.1.2.2/24 1.1.1.1/241.1.2.2/24 what’s going on ?? 1.1.1.3/16 A B C DestMaskGateway 1.1.1.024L: 1.1.1.1 0.0.0.001.1.1.100 IP interface: 1.1.1.1/24 Interface route

15 Network Layer5-15 IP/Ethernet configuration 1.1.1.1/24 default route: 1.1.1.100 1.1.2.2/24 default route: 1.1.2.100 1.1.1.100/24 1.1.2.100/24 DestMaskGateway 1.1.1.024L:1.1.1.1 0.0.0.001.1.1.100 Internet

16 Network Layer5-16 IP/Ethernet configuration 192.168.1.1/16 default route: 192.168.1.100 192.168.1.3/24 default route: 192.168.1.100 192.168.1.100/24 192.168.2.100/24 192.168.2.4/24 default route: 192.168.2.100 A C D IP reachability: switch --- from ABCDABCD A B C D to 192.168.2.2/24 default route: 192.168.2.100 B router

17 Network Layer5-17 IP datagram format ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier Internet checksum time to live 32 bit source IP address IP protocol version number header length (bytes) max number remaining hops (decremented at each router) for fragmentation/ reassembly total datagram length (bytes) upper layer protocol to deliver payload to head. len type of service “type” of data flgs fragment offset upper layer 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit. how much overhead with TCP? r 20 bytes of TCP r 20 bytes of IP r = 40 bytes + app layer overhead

18 Network Layer5-18 IP Fragmentation & Reassembly r network links have MTU (max.transfer size) - largest possible link-level frame. m different link types, different MTUs r large IP datagram divided (“fragmented”) within net m one datagram becomes several datagrams m “reassembled” only at final destination m IP header bits used to identify, order related fragments fragmentation: in: one large datagram out: 3 smaller datagrams reassembly

19 Network Layer5-19 IP Fragmentation and Reassembly ID =x offset =0 fragflag =0 length =4000 ID =x offset =0 fragflag =1 length =1500 ID =x offset =185 fragflag =1 length =1500 ID =x offset =370 fragflag =0 length =1040 One large datagram becomes several smaller datagrams Example r 4000 byte datagram r MTU = 1500 bytes 1480 bytes in data field offset = 1480/8

20 Network Layer5-20 ICMP: Internet Control Message Protocol r used by hosts & routers to communicate network-level information m error reporting: unreachable host, network, port, protocol m echo request/reply (used by ping) r network-layer “above” IP: m ICMP msgs carried in IP datagrams r ICMP message: type, code plus first 8 bytes of IP datagram causing error Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header

21 Network Layer5-21 Traceroute and ICMP r Source sends series of UDP segments to dest m First has TTL =1 m Second has TTL=2, etc. m Unlikely port number r When nth datagram arrives to nth router: m Router discards datagram m And sends to source an ICMP message (type 11, code 0) m Message includes name of router& IP address r When ICMP message arrives, source calculates RTT r Traceroute does this 3 times Stopping criterion r UDP segment eventually arrives at destination host r Destination returns ICMP “host unreachable” packet (type 3, code 3) r When source gets this ICMP, stops.

22 Network Layer5-22 IPv6 r Initial motivation: 32-bit address space soon to be completely allocated. r Additional motivation: m header format helps speed processing/forwarding m header changes to facilitate QoS IPv6 datagram format: m fixed-length 40 byte header m no fragmentation allowed

23 Network Layer5-23 IPv6 Header (Cont) Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). Next header: identify upper layer protocol for data

24 Network Layer5-24 Other Changes from IPv4 r Checksum: removed entirely to reduce processing time at each hop r Options: allowed, but outside of header, indicated by “Next Header” field r ICMPv6: new version of ICMP m additional message types, e.g. “Packet Too Big” m multicast group management functions

25 Network Layer5-25 Transition From IPv4 To IPv6 r Not all routers can be upgraded simultaneous m no “flag days” m How will the network operate with mixed IPv4 and IPv6 routers? r Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers

26 Network Layer5-26 Tunneling A B E F IPv6 tunnel Logical view: Physical view: A B E F IPv6 C D IPv4 Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Flow: X Src: A Dest: F data Src:B Dest: E Flow: X Src: A Dest: F data Src:B Dest: E A-to-B: IPv6 E-to-F: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4

27 Network Layer5-27 Future of IPv6? hourglass  wineglass?


Download ppt "Network Layer5-1 2016 session 1 TELE3118: Network Technologies Week 5: Network Layer Forwarding, Features Some slides have been taken from: r Computer."

Similar presentations


Ads by Google