Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4 Network Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley Chapter4_2 Transport Layer.

Similar presentations


Presentation on theme: "Chapter 4 Network Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley Chapter4_2 Transport Layer."— Presentation transcript:

1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley Chapter4_2 Transport Layer

2 Two key network-layer functions
Forwarding: Move packets on the router from input port to appropriate output port All ports have input/output capability Essentially, a network within a router! Routing: Determine route taken by packets from source to destination Routing algorithms Link State Distance Vector Network Layer

3 Network service model Example Services: Guaranteed delivery
Guaranteed delivery with bounded delay In-order packet delivery Guaranteed minimum bandwidth Guaranteed maximum jitter Security services None of these provided by Network layer Some provided by Transport layer Network layer: “Best-effort service” Network Layer

4 Datagram networks No call setup at network layer
Routers: no state about end-to-end connections No network-level concept of “connection” Packets forwarded using destination host address Routing algorithms used to update forwarding tables application transport network data link physical application transport network data link physical 1. send datagrams 2. receive datagrams Network Layer

5 Two key network-layer functions
Forwarding: Move packets on the router from input port to appropriate output port All ports have input/output capability Essentially, a network within a router! Routing: Determine route taken by packets from source to destination Routing algorithms Link State Distance Vector Network Layer

6 Interplay between routing and forwarding
1 2 3 0111 value in arriving packet’s header routing algorithm local forwarding table header value output link 0100 0101 1001 routing algorithm determines end-end-path through network forwarding table determines local forwarding at this router Network Layer

7 Switching fabrics Transfer packet from input buffer to appropriate output buffer Switching rate: Rate at which packets can be transfer from inputs to outputs Often measured as multiple of input/output line rate N inputs: switching rate N times line rate desirable Three types of switching fabrics memory memory bus crossbar Network Layer

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

9 Chapter 4: outline 4.1 introduction
4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Network Layer

10 IP addressing: introduction
IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link router’s typically have multiple interfaces host typically has one or two interfaces (e.g., wired Ethernet, wireless ) IP addresses associated with each interface = 223 1 1 1 Network Layer

11 IP addressing: introduction
Q: how are interfaces actually connected? A: wired Ethernet interfaces connected by Ethernet switches A: wireless WiFi interfaces connected by WiFi base station For now: don’t need to worry about how one interface is connected to another (with no intervening router) Network Layer

12 Subnets IP address: What’s a subnet ? subnet part - high order bits
host part - low order bits What’s a subnet ? Logical, visible subdivision of a larger IP network Hosts can physically reach each other without intervening router How? subnet network consisting of 3 subnets Network Layer

13 Subnets /24 /24 /24 subnet To determine the subnets, detach each interface from its host or router, creates islands of isolated networks Each isolated network is called a subnet subnet mask: /24 Network Layer

14 Subnets How many subnets? 223.1.1.2 223.1.1.1 223.1.1.4 223.1.1.3
Network Layer

15 IP addressing IP address (IPv4): 4 octets, range: 28 or 256 values
32 bits 232 = ~4 billion possible IP addresses Enough addresses? Written in dotted-decimal notation 4 bytes, separated by dot Ex: 4 octets, range: 28 or 256 values 0 – 255 Interfaces on every host and router on the Internet must have a globally unique IP address. Except interfaces behind NAT routers Network Layer

16 IP addressing: CIDR CIDR: Classless InterDomain Routing
subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address subnet part host part /23 Network Layer

17 IP addressing: CIDR In the example below, the first 23 bits are common for all devices in the subnet How many unique interfaces (router interfaces and hosts)? 32 bits – 23 bits: 9 bits 29 = 512 unique interfaces IP range: subnet part host part /23 Network Layer

18 IP addressing: Subnet Masking
Shares IP address format Is not an IP address Used together with interface IP address to determine subnet Ex: Subnet: a.b.c.d/24 Subnet mask: Perform bit-wise logical AND: Interface/host belongs to subnet /24 Network Layer

19 IP addresses: how to get one?
Q: How does a host get IP address? hard-coded by system admin in a file Windows: control-panel->network->configuration->tcp/ip->properties UNIX: /etc/rc.config DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server “plug-and-play” Network Layer

20 DHCP: Dynamic Host Configuration Protocol
Goal: Allow hosts to dynamically obtain an IP address from network server when it joins network Host can renew address in use Allows reuse of addresses in pool Ex: DHCP IP range, – Support for mobile users who want to join network DHCP overview: Host broadcasts “DHCP discover” DHCP server responds with “DHCP offer” Host requests IP address: “DHCP request” DHCP server sends address: “DHCP ACK” Network Layer

21 DHCP client-server scenario
/24 arriving DHCP client needs address in this network /24 /24 Network Layer

22 DHCP client-server scenario
DHCP server: DHCP discover src : , 68 dest.: ,67 yiaddr: transaction ID: 654 arriving client Broadcast: is there a DHCP server out there? DHCP offer src: , 67 dest: , 68 yiaddrr: transaction ID: 654 lifetime: 3600 secs Broadcast: I’m a DHCP server! Here’s an IP address you can use DHCP request src: , 68 dest:: , 67 yiaddrr: transaction ID: 655 lifetime: 3600 secs Broadcast: OK. I’ll take that IP address! DHCP ACK src: , 67 dest: , 68 yiaddrr: transaction ID: 655 lifetime: 3600 secs Broadcast: OK. You’ve got that IP address! Network Layer

23 DHCP: more than IP addresses
DHCP can return more than just allocated IP address on subnet: Address of first-hop router for client Name and IP address of DNS sever Subnet mask Network Layer

24 IP addresses: how to get one?
Q: how does network get subnet part of IP addr? A: gets allocated portion of its provider ISP’s address space ISP's block /20 Organization /23 Organization /23 Organization /23 … … …. Organization /23 Network Layer

25 IP addresses: how to get one?
Q: how does network get subnet part of IP addr? A: gets allocated portion of its provider ISP’s address space ISP's block /20 How many unique IP addresses? 32bits – 20bits: 12, so 212 unique addresses for ISP ~4096 IP addresses Network Layer

26 IP addresses: how to get one?
Q: how does network get subnet part of IP addr? A: gets allocated portion of its provider ISP’s address space Organization /23 How many unique IP addresses? 32bits – 23bits: 9, so 29 unique addresses for Organization 0 ~512 IP addresses Network Layer

27 Hierarchical addressing: route aggregation
hierarchical addressing allows efficient advertisement of routing information: Organization 0 /23 Organization 1 “Send me anything with addresses beginning /20” /23 Organization 2 /23 . Fly-By-Night-ISP . Internet Organization 7 /23 “Send me anything with addresses beginning /16” ISPs-R-Us Network Layer

28 Hierarchical addressing: more specific routes
ISPs-R-Us has a more specific route to Organization 1 Organization 0 /23 “Send me anything with addresses beginning /20” Organization 2 /23 . Fly-By-Night-ISP . Internet Organization 7 /23 “Send me anything with addresses beginning /16 or /23” ISPs-R-Us Organization 1 /23 Network Layer

29 IP addressing: the last word...
Q: how does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers Allocates addresses Manages DNS root servers Assigns domain names, resolves disputes Network Layer

30 NAT: network address translation
rest of Internet local network (e.g., home network) 10.0.0/24 all datagrams leaving local network have same single source NAT IP address: different source port numbers datagrams with source or destination in this network have /24 address for source, destination (as usual) Network Layer

31 NAT: network address translation
motivation: Local network uses just one IP address as far as outside world is concerned: range of addresses not needed from ISP: just one IP address for all devices can change addresses of devices in local network without notifying outside world can change ISP without changing addresses of devices in local network devices inside local net not explicitly addressable, visible by outside world (a security plus) Network Layer

32 NAT: network address translation
Implementation: Outgoing data: Replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) remote clients/servers will respond using (NAT IP address, new port #) as destination address NAT translation table: Every (source IP address, port #) translated to (NAT IP address, new port #) Incoming datagrams: replace (NAT IP address, new port #) of every incoming datagram with corresponding (source IP address, port #) stored in NAT table Network Layer

33 NAT: network address translation
NAT translation table WAN side addr LAN side addr 1: host sends datagram to , 80 2: NAT router changes datagram source addr from , 3345 to , 5001, updates table , , 3345 …… …… S: , 3345 D: , 80 1 S: , 80 D: , 3345 4 S: , 5001 D: , 80 2 S: , 80 D: , 5001 3 4: NAT router changes datagram dest addr from , 5001 to , 3345 3: reply arrives dest. address: , 5001 Network Layer

34 NAT: network address translation
16-bit port-number field: 60,000 simultaneous connections with a single LAN-side address! NAT is controversial: routers should only process up to layer 3 violates end-to-end argument NAT possibility must be taken into account by app designers, e.g., P2P applications address shortage should instead be solved by IPv6 Network Layer

35 NAT traversal problem External client wants to connect to internal server with address Server address local to LAN External client can’t use it as destination address Only one externally visible NAT address: Solution1: Statically configure NAT to forward incoming connection requests at given port to internal server Ex: ( , port 2500) always forwarded to port 25000 client ? NAT router Network Layer

36 NAT traversal problem Solution 2:
Universal Plug and Play (UPnP) Internet Gateway Device (IGD) Protocol. Allows NATed host to: learn public IP address ( ) add/remove port mappings (with lease times) Automate static NAT port map configuration NAT router IGD Network Layer

37 NAT: things to consider
Generally bundled with Ethernet and Wi-Fi interfaces Ethernet interface: 100 Mbps or 1Gbps How this affects LAN throughput Using internal switches Wi-Fi interface: 802.11b/g/n/a/ac Throughput MIMO Demilitarized Zone (DMZ): Less restrictive zone/host/subnet which allows hosts outside the private network to communicate easily Accomplished by modifying iptable rules on NAT router Network Layer

38 Chapter 4: outline 4.1 introduction
4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol datagram format IPv4 addressing ICMP IPv6 4.5 routing algorithms link state distance vector hierarchical routing 4.6 routing in the Internet RIP OSPF BGP 4.7 broadcast and multicast routing Network Layer

39 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

40 Traceroute and ICMP source sends series of UDP segments to dest
first set has TTL =1 second set has TTL=2, etc. unlikely port number when nth set of datagrams arrives to nth router: router discards datagrams and sends source ICMP messages (type 11, code 0) ICMP messages includes name of router & IP address when ICMP messages arrives, source records RTTs stopping criteria: UDP segment eventually arrives at destination host destination returns ICMP “port unreachable” message (type 3, code 3) source stops 3 probes 3 probes 3 probes Network Layer

41 IPv6: motivation Initial motivation: Additional 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

42 IPv6 datagram format 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 ver pri flow label payload len next hdr hop limit source address (128 bits) destination address (128 bits) data 32 bits Network Layer

43 Other changes from IPv4 checksum: removed entirely to reduce processing time at each hop Not needed since checksumming already occurs at Layer 4 and Layer 2 ICMPv6: new version of ICMP Additional message types, e.g. “Packet Too Big” Multicast group management functions Network Layer

44 Transition from IPv4 to IPv6
Not all routers can be upgraded simultaneously No “flag days” How will network operate with mixed IPv4 and IPv6 routers? Tunneling: IPv6 datagram carried as payload in IPv4 datagram among IPv4 routers IPv4 header fields UDP/TCP payload IPv6 source dest addr IPv6 header fields IPv4 payload IPv4 source, dest addr IPv6 datagram IPv4 datagram Network Layer

45 connecting IPv6 routers
Tunneling logical view: IPv4 tunnel connecting IPv6 routers E IPv6 F A B A B IPv6 C D E IPv6 F physical view: IPv4 IPv4 Network Layer

46 connecting IPv6 routers
Tunneling logical view: IPv4 tunnel connecting IPv6 routers E IPv6 F A B A B IPv6 C D E IPv6 F physical view: IPv4 IPv4 flow: X src: A dest: F data A-to-B: IPv6 Flow: X Src: A Dest: F data src:B dest: E B-to-C: IPv6 inside IPv4 B-to-C: IPv6 inside IPv4 Flow: X Src: A Dest: F data src:B dest: E E-to-F: IPv6 flow: X src: A dest: F data Network Layer

47 IPv6: adoption US National Institutes of Standards estimate [2013]:
~3% of industry IP routers ~11% of US gov’t routers Long (long!) time for deployment, use 20 years and counting! Think of changes in last 20 years: WWW, Facebook, Netflix, Cloud computing, Internet of things, … Why? Network layer protocols extremely difficult to change Fundamental protocols for data exchange over the Internet Network Layer


Download ppt "Chapter 4 Network Layer Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley Chapter4_2 Transport Layer."

Similar presentations


Ads by Google