Download presentation
Presentation is loading. Please wait.
1
2012 session 1 TELE3118: Network Technologies Week 5: Network Layer Forwarding, Features
Some slides have been taken from: Computer Networking: A Top Down Approach Featuring the Internet, 4th edition. Jim Kurose, Keith Ross. Addison-Wesley, July All material copyright J.F Kurose and K.W. Ross, All Rights Reserved. Computer Networks, 4th edition. Andrew S. Tanenbaum. Prentice-Hall, 2003. Network Layer
2
IP Forwarding IP datagram: Case I: hosts in same LAN (A B)
misc fields source IP addr dest data A Case I: hosts in same LAN (A B) Case II: hosts in different LANs (A E) A note on terminology: Switch (bridge) vs. Router Hardware vs. software? layer-2 vs. layer-3? B E Network Layer
3
Case I: hosts in same LAN
misc fields data routing table at A Dest Mask Next-hop 24 L: Starting at A, dest. B: look up dest-IP in routing table dest is in LAN on interface send datagram directly to B in Ethernet frame how to determine B’s Ethernet MAC address? A B E B’s MAC addr A’s MAC A’s IP B’s IP IP payload datagram frame frame source, dest address datagram source, Network Layer
4
ARP: Address Resolution Protocol
Each IP node (Host, Router) on LAN has ARP table ARP Table: IP/MAC address mappings for same LAN nodes < IP address; MAC address; TTL> TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Network Layer
5
ARP protocol ARP is “plug-and-play”:
A wants to send datagram to B, and A knows B’s IP address. Suppose B’s MAC address is not in A’s ARP table. A broadcasts ARP query packet, containing B's IP address all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address frame sent to A’s MAC address (unicast) 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 ARP is “plug-and-play”: nodes create their ARP tables without intervention from net administrator Network Layer
6
Case II: hosts in different LANs
routing table at A misc fields data Dest Mask Next-hop 24 L: Starting at A, dest. E: look up network address of E in routing table E on different network A, E not directly attached routing table: next hop router to E is link layer sends datagram to router in Ethernet frame (ARP) datagram arrives at continued….. A B E Network Layer
7
Case II (contd.) routing table in router
misc fields data Dest Mask Next-hop 24 L: L: L: Arriving at , destined for look up network address of E in router’s routing table E on same network as router’s interface router, E directly attached link layer sends datagram to in Ethernet frame via interface (ARP) datagram arrives at !!! (hooray!) A B E Network Layer
8
Packet walk-through A (111.111.111.111) B (222.222.222.222) A R B
Each node (host/router) has Route table: dest/mask next-hop ARP table: LAN IP addr MAC address Network Layer
9
A R B A creates datagram with source A, destination B
A uses ARP to get R’s MAC address for A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram A’s data link layer sends frame R’s data link layer receives frame R removes IP datagram from Ethernet frame, sees its destined to B R uses ARP to get B’s physical layer address R creates frame containing A-to-B IP datagram sends to B B receives the frame and extracts IP datagram A R B Network Layer
10
To switch or route? Assume unicast traffic Lookup dMAC in MAC-table
1 3 ?? sMAC dMAC sIP dIP ----Data---- vlan 100 vlan 200 2 4 Assume unicast traffic Lookup dMAC in MAC-table If (dMAC ≠ interface MAC) switch switch (bridge) the frame as is onto learnt port Else frame is for upper layer (IP) route Lookup dest-IP in routing table (discard if no match) Determine next hop MAC addr (ARP table) Send datagram with new Ethernet header Network Layer
11
Switch-Router MAC table
VLAN MAC address port 3 10 6 00-4E-3A-02-08 Self 4 76 A3 7 8 B 2018 00-4E-3A-02-10 router IP interfaces on VLANs 3 and 2018 No router IP interface on VLAN 76 Network Layer
12
Switch-Router routing table
local destination mask next-hop default route 8 20 23 24 L /24 /24 LAN interfaces /24 Network Layer
13
Unicast forwarding algorithm
Host receive: dest-MAC address mine? Send: yes extract IP datagram Determine most specific match in routing table no dest-IP address mine? no found one? no yes discard yes local intf? drop packet yes no pass datagram data to upper layer dest on same LAN. nh-IP = dest-IP next-hop is router. nh-IP = gway-IP Switch/router receive: dest-MAC address mine? yes extract IP datagram nh-IP in ARP table? send ARP request and wait for response no no switch Ethernet frame yes dest-IP address mine? get ARP response and fill in ARP table no Route IP datagram yes construct Ethernet header and send frame pass datagram data to upper layer Network Layer
14
IP/Ethernet configuration
Dest Mask Gateway 24 L: IP interface: /24 Interface route /24 /24 /24 /24 /24 /24 B A what’s going on ?? C /16 Network Layer
15
IP/Ethernet configuration
Dest Mask Gateway 24 L: /24 default route: /24 default route: /24 /24 Internet Network Layer
16
IP/Ethernet configuration
/16 default route: A /24 /24 B D switch /24 default route: /24 default route: router C /24 default route: IP reachability: to A B C D from A B C D --- Network Layer
17
32 bit destination IP address
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? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead Network Layer
18
IP Fragmentation & Reassembly
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 fragmentation: in: one large datagram out: 3 smaller datagrams reassembly Network Layer
19
IP Fragmentation and Reassembly
ID =x offset =0 fragflag length =4000 =1 =1500 =185 =370 =1040 One large datagram becomes several smaller datagrams Example 4000 byte datagram MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 Network Layer
20
ICMP: Internet Control Message Protocol
used by hosts & routers to communicate network-level information error reporting: unreachable host, network, port, protocol echo request/reply (used by ping) network-layer “above” IP: ICMP msgs carried in IP datagrams ICMP message: type, code plus first 8 bytes of IP datagram causing error Type Code description echo reply (ping) dest. network unreachable dest host unreachable dest protocol unreachable dest port unreachable dest network unknown dest host unknown source quench (congestion control - not used) echo request (ping) route advertisement router discovery TTL expired bad IP header Network Layer
21
Traceroute and ICMP Source sends series of UDP segments to dest
First has TTL =1 Second has TTL=2, etc. Unlikely port number When nth datagram arrives to nth router: Router discards datagram And sends to source an ICMP message (type 11, code 0) Message includes name of router& IP address When ICMP message arrives, source calculates RTT Traceroute does this 3 times Stopping criterion UDP segment eventually arrives at destination host Destination returns ICMP “host unreachable” packet (type 3, code 3) When source gets this ICMP, stops. Network Layer
22
IPv6 Initial motivation: 32-bit address space soon to be completely allocated. Additional motivation: header format helps speed processing/forwarding header changes to facilitate QoS IPv6 datagram format: fixed-length 40 byte header no fragmentation allowed Network Layer
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 Network Layer
24
Other Changes from IPv4 Checksum: removed entirely to reduce processing time at each hop Options: allowed, but outside of header, indicated by “Next Header” field ICMPv6: new version of ICMP additional message types, e.g. “Packet Too Big” multicast group management functions Network Layer
25
Transition From IPv4 To IPv6
Not all routers can be upgraded simultaneous no “flag days” How will the network operate with mixed IPv4 and IPv6 routers? Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers Network Layer
26
Tunneling A B E F Logical view: A B C D E F Physical view: Src:B
IPv6 IPv6 IPv6 IPv6 A B C D E F Physical view: IPv6 IPv6 IPv4 IPv4 IPv6 IPv6 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 Flow: X Src: A Dest: F data A-to-B: IPv6 E-to-F: IPv6 B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4 Network Layer
27
Future of IPv6? hourglass wineglass? Network Layer
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.