Network Layer session 1 TELE3118: Network Technologies Week 4: Network Layer Basics, Addressing 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, All material copyright. J.F Kurose and K.W. Ross, All Rights Reserved. r Computer Networks, 4 th edition. Andrew S. Tanenbaum. Prentice-Hall, 2003.
Network Layer4-2 Why an internet layer? r Why not one big flat LAN? m Different LAN protocols m Flat address space not scalable r IP provides: m Global addressing m Scaling to WANs m Virtualization of network isolates end-to-end protocols from network details/changes r Why a single IP? m Maximise interoperability m Minimise service interfaces r Why a narrow IP? m Least common network functionality “hourglass model” (Steve Deering)
Network Layer4-3 IP functions r Addressing r Transport packet from address A to address B r Where does IP run? m every host m every router Mechanisms for: r Addressing: assigning addresses to hosts/routers r Route determination: algorithms to compute route to get packet to destination r Forwarding: move packets from source to destination network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical application transport network data link physical
Network Layer value in arriving packet’s header routing algorithm local forwarding table header value output link Interplay between routing and forwarding
Network Layer4-5 Network service model Q: What service model for “channel” transporting datagrams from sender to rcvr? r Connection-oriented network service: m Virtual Circuits r Connection-less network service: m Datagrams
Network Layer4-6 Virtual circuits r call setup, teardown for each call before data can flow r each packet carries VC identifier (not destination host address) r every router on source-dest path maintains “state” for each passing connection r link, router resources (bandwidth, buffers) may be allocated to VC “source-to-dest path behaves much like telephone circuit” m performance-wise m network actions along source-to-dest path
Network Layer4-7 Datagram networks r no call setup at network layer r routers: no state about end-to-end connections m no network-level concept of “connection” r packets forwarded using destination host address m packets between same source-dest pair may take different paths application transport network data link physical application transport network data link physical 1. Send data 2. Receive data
Network Layer4-8 Datagram or VC network: why? Internet r data exchange among computers m “elastic” service, no strict timing req. r “smart” end systems (computers) m can adapt, perform control, error recovery m simple inside network, complexity at “edge” r many link types m different characteristics m uniform service difficult Asynchronous Transfer Mode (ATM) r evolved from telephony r human conversation: m strict timing, reliability requirements m need for guaranteed service r “dumb” end systems m telephones m complexity inside network
Network Layer4-9 IP: Mid-life crisis
Network Layer4-10 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection RIP, OSPF, BGP IP protocol addressing conventions datagram format packet handling conventions ICMP protocol error reporting router “signaling” Transport layer: TCP, UDP Link layer physical layer Network layer
Network Layer4-11 Addressing r IP address: m 4-bytes = 32-bits m Dot-notation m Globally unique m Hierarchical: network + host r IP versus Ethernet m Hierarchical vs. flat m Portability: “location” vs. “identification” =
Network Layer4-12 Subnets r IP address: m subnet part (high order bits) m host part (low order bits) r What’s a subnet ? m device interfaces with same subnet part of IP address m can physically reach each other without intervening router network consisting of 3 subnets LAN
Network Layer4-13 Subnets How many?
Network Layer4-14 IP addressing: “class-full” 0 network host 10 network host 110 networkhost 1110 multicast address A B C D class to to to to bits r Classful addressing: m inefficient use of address space, address space exhaustion m e.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that network
Network Layer4-15 IP addressing: “class-less” CIDR: Classless InterDomain Routing m subnet portion of address of arbitrary length m address format: a.b.c.d/x, where x is # bits in subnet portion of address subnet part host part /23
Network Layer4-16 IP addresses: how to get one? Q: How does host get IP address? r hard-coded by system admin in a file m Wintel: control-panel->network->configuration- >tcp/ip->properties m UNIX: /etc/rc.config r DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server m “plug-and-play” (more in next chapter)
Network Layer4-17 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 Layer4-18 Hierarchical addressing: route aggregation “Send me anything with addresses beginning /20” / / /23 Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “Send me anything with addresses beginning /16” /23 Organization Hierarchical addressing allows efficient advertisement of routing information:
Network Layer4-19 Hierarchical addressing: more specific routes ISPs-R-Us has a more specific route to Organization 1 “Send me anything with addresses beginning /20” / / /23 Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “Send me anything with addresses beginning /16 or /23” /23 Organization
Network Layer4-20 IP addressing: the last word... Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers m allocates addresses m manages DNS m assigns domain names, resolves disputes
Network Layer4-21 NAT: Network Address Translation local network (e.g., home network) /24 rest of Internet Datagrams with source or destination in this network have /24 address for source, destination (as usual) All datagrams leaving local network have same single source NAT IP address: , different source port numbers
Network Layer4-22 NAT: Network Address Translation r Motivation: local network uses just one IP address as far as outside word is concerned: m no need to be allocated range of addresses from ISP: - just one IP address is used for all devices m can change addresses of devices in local network without notifying outside world m can change ISP without changing addresses of devices in local network m devices inside local net not explicitly addressable, visible by outside world (a security plus).
Network Layer4-23 NAT: Network Address Translation Implementation: NAT router must: m 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. m remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair m 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 Layer4-24 NAT: Network Address Translation S: , 3345 D: , : host sends datagram to , 80 NAT translation table WAN side addr LAN side addr , , 3345 …… S: , 80 D: , S: , 5001 D: , : NAT router changes datagram source addr from , 3345 to , 5001, updates table S: , 80 D: , : Reply arrives dest. address: , : NAT router changes datagram dest addr from , 5001 to , 3345
Network Layer4-25 NAT: Network Address Translation r 16-bit port-number field: m 60,000 simultaneous connections with a single LAN-side address! r NAT is controversial: m routers should only process up to layer 3 m violates end-to-end argument NAT possibility must be taken into account by app designers, eg, P2P applications m address shortage should instead be solved by IPv6