Chapter 4. Network Layer

of 21

Please download to get full document.

View again

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
PDF
21 pages
0 downs
4 views
Share
Description
1DT066 Distributed Information System Chapter 4 Network Layer CHAPTER 4: NETWORK LAYER Chapter goals: Understand principles behind layer services: layer service models forwarding vs routing how a router
Transcript
1DT066 Distributed Information System Chapter 4 Network Layer CHAPTER 4: NETWORK LAYER Chapter goals: Understand principles behind layer services: layer service models forwarding vs routing how a router works routing (path selection) dealing with scale advanced topics: IPv6, mobility Implementation in the Internet 1 CHAPTER 4: NETWORK LAYER 4. 1 Introduction 4.2 Virtual circuit and datagram s 4.3 What s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing IPv6 ESSENCE OF NETWORKING LAYER A B Data Link Physical 2 NETWORK LAYER transport segment from sending to receiving host on sending side encapsulates segments into datagrams on receiver side, delivers segments to transport layer layer protocols in every host, router router examines header fields in all IP datagrams passing through it application transport Network Layer application transport TWO KEY NETWORK-LAYER FUNCTIONS forwarding: move packets from router s input to correct router output routing: determine route taken by packets from source to destination. routing algorithms (e.g., OSPF, BGP) 3 Interplay of forwarding and routing Value in arriving packet s header routing algorithm 3 2 local forwarding table header output value link CHAPTER 4: NETWORK LAYER 4. 1 Introduction 4.2 Virtual Circuit and Datagram s 4.3 What s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4 NETWORK LAYER CONNECTION AND CONNECTION-LESS SERVICE Datagram provides -layer connectionless service VC provides -layer connection service VIRTUAL CIRCUITS source-to-dest path behaves like a telephone circuit performance benefits actions along source-to-dest path each packet carries VC identifier (not destination host address) every router on source-dest path maintains state for each passing connection link, router resources (bandwidth, buffers) may be allocated to VC (dedicated resources = predictable service) 5 VC FORWARDING TABLE VC number Forwarding table in northwest router: Interface number Incoming interface Incoming VC # Outgoing interface Outgoing VC # Routers maintain connection state information! VIRTUAL CIRCUITS: SIGNALING PROTOCOLS used in ATM, frame-relay, X.25 not used in today s Internet application transport 5. Data flow begins 6. Receive data 4. Call connected 3. Accept call 1. Initiate call 2. incoming call application transport 6 DATAGRAM NETWORKS no call setup at layer routers: no state about end-to-end connections no -level concept of connection packets forwarded using destination host address packets between same source-dest pair may take different paths application transport 1. Send data 2. Receive data application transport FORWARDING TABLE 4 billion possible entries! Destination Address Range Link Interface through through through Otherwise 3 7 LONGEST PREFIX MATCHING Prefix Match Link Interface Otherwise 3 Examples: DEST: Which interface? DEST: Which interface? CHAPTER 4: NETWORK LAYER 4. 1 Introduction 4.2 Virtual circuit and datagram s 4.3 What s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing IPv6 8 ROUTER ARCHITECTURE OVERVIEW Two key router functions: run routing algorithms/protocol (RIP, OSPF, BGP) forwarding datagrams from incoming to outgoing link CHAPTER 4: NETWORK LAYER 4. 1 Introduction 4.2 Virtual circuit and datagram s 4.3 What s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing IPv6 9 THE INTERNET NETWORK LAYER Host, router layer functions: Transport layer: TCP, UDP Network layer Routing protocols path selection RIP, OSPF, BGP forwarding table IP protocol addressing conventions datagram format packet handling conventions ICMP protocol error reporting router signaling Link layer Physical layer CHAPTER 4: NETWORK LAYER 4. 1 Introduction 4.2 Virtual circuit and datagram s 4.3 What s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing IPv6 10 IP DATAGRAM FORMAT IP protocol version number header length (bytes) type of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to ver head. len 16-bit identifier time to live 32 bits type of service upper layer flgs length fragment offset header checksum 32 bit source IP address 32 bit destination IP address Options (if any) Data (variable length, typically a TCP or UDP segment) total datagram length (bytes) fragmentation/ reassembly IP FRAGMENTATION & REASSEMBLY Network links have MTU (max.transfer size) largest possible link-level frame. 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: 1 large out: 3 small reassembly 11 IP FRAGMENTATION AND REASSEMBLY Example 4000 byte datagram MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 length =4000 ID =x length =1500 fragflag =0 ID =x ID =x offset =0 One large datagram becomes several smaller datagrams length =1500 length =1040 ID =x fragflag =1 fragflag =1 fragflag =0 offset =0 offset =185 offset =370 Network Layer CHAPTER 4: NETWORK LAYER 4. 1 Introduction 4.2 Virtual circuit and datagram s 4.3 What s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing IPv6 12 IP ADDRESSING: INTRODUCTION IP address: 32-bit identifier for host, router interface interface: connection between host/router and link router s typically have multiple interfaces host typically has one interface IP addresses associated with each interface = SUBNETS IP address: subnet part (high order bits) host part (low order bits) What is a subnet? device interfaces with same subnet part of IP address can ly reach each other without intervening router subnet part /24 host part 13 SUBNETS To determine the subnets, detach each interface from its host or router, creating islands of isolated s. Each isolated is called a subnet / / /24 Subnet mask: /24 SUBNETS How many? 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 /23 host part 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- - configuration- tcp/ip- properties UNIX: /etc/rc.config DHCP: Dynamic Host Configuration Protocol: dynamically get address from a server plug-and-play 15 DHCP: DYNAMIC HOST CONFIGURATION PROTOCOL Goal: allow host to dynamically obtain its IP address from server when it joins Allows reuse of addresses A DHCP server B E arriving DHCP client needs address in this DHCP CLIENT-SERVER SCENARIO DHCP server: DHCP discover src : , 68 dest.: ,67 yiaddr: transaction ID: 654 arriving client time DHCP request DHCP offer src: , 68 dest:: , 67 yiaddrr: transaction ID: 655 Lifetime: 3600 secs src: , 67 dest: , 68 yiaddrr: transaction ID: 654 Lifetime: 3600 secs Network Layer DHCP ACK src: , 67 dest: , 68 yiaddrr: transaction ID: 655 Lifetime: 3600 secs IP ADDRESSES: HOW TO GET ONE? Q: How does get subnet part of IP addr? A: It s allocated portion of its provider ISP s address space ISP's block /20 Organization /23 Organization /23 Organization / Organization /23 HIERARCHICAL ADDRESSING: ROUTE AGGREGATION Hierarchical addressing allows efficient advertisement of routing information: Organization /23 Organization /23 Organization /23 Organization /23. ISP Inc. Send me anything with addresses beginning /20 Internet Network Layer ISPs-R-Us Send me anything with addresses beginning /16 17 NAT: NETWORK ADDRESS TRANSLATION rest of Internet local (e.g., home ) / All datagrams leaving local have same single source NAT IP address: , different source port numbers Datagrams with source or destination in this have /24 address for source, destination (as usual) 4-35 NAT: NETWORK ADDRESS TRANSLATION Motivation: local uses just one IP address as far as outside world is concerned: Only one IP address for all devices Can change addresses of devices in LAN without notifying outside world Can change ISP without changing addresses of devices in local Devices inside local net not explicitly addressable, visible by outside world (a security plus). Network Layer NAT: NETWORK ADDRESS TRANSLATION Implementation: NAT router must: outgoing datagrams: 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 addr. remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table Network Layer NAT: NETWORK ADDRESS TRANSLATION 2: NAT router changes datagram source addr from , 3345 to , 5001, updates table 2 NAT translation table WAN side addr LAN side addr , , 3345 S: , 5001 D: , S: , 80 D: , : Reply arrives dest. address: , S: , 3345 D: , 80 1 S: , 80 D: , : host sends datagram to , 80 Network Layer : NAT router changes datagram dest addr from , 5001 to , CHAPTER 4: NETWORK LAYER 4. 1 Introduction 4.2 Virtual circuit and datagram s 4.3 What s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing IPv6 Network Layer IPV6 Initial motivation: 32-bit address space soon to be completely allocated. Additional motivation: Header format helps speed processing/forwarding In-built DHCP Header changes to facilitate QoS IPv6 datagram format: Fixed-length 40 byte header No fragmentation allowed 20 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 CHAPTER 4: SUMMARY 4. 1 Introduction 4.2 Virtual circuit and datagram s 4.3 What s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing IPv6 21
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks