Computer Networks Lecture 3 PDF

Document Details

CuteWatermelonTourmaline

Uploaded by CuteWatermelonTourmaline

Kangwon National University

Tags

computer networks internet protocol ip addressing networking

Summary

This lecture provides an introduction to the Internet Protocol (IP) within computer networks. Topics include datagram formats, addressing schemes, network address translation (NAT), and the motivation behind IPv6. The lecture also explains subnet concepts and the Dynamic Host Configuration Protocol (DHCP).

Full Transcript

Computer Networks Lecture #3 In the last lecture Introduction to the network layer What’s inside a router Input ports, switching, output ports bu er management, scheduling ff Today IP - the Internet Protocol Datagram format Addressing Network addre...

Computer Networks Lecture #3 In the last lecture Introduction to the network layer What’s inside a router Input ports, switching, output ports bu er management, scheduling ff Today IP - the Internet Protocol Datagram format Addressing Network address translation & IPv6 Internet Protocol (IP) Network layer: Internet Host, router network layer functions IP Datagram format IP Datagram format IP fragmentation, reassembly Network links have MTU (max transfer size) Largest possible link-layer frame Di erent link types → Di erent MTUs Large IP datagram divided (“fragmented”) within net One datagram becomes several datagrams “Reassembled” only at the nal destination IP header bits used to identify/order related fragments ff ff fi IP fragmentation / reassembly Example 4000 byte datagram MTU = 1500bytes IP addressing: introduction IP address 32-bit identi er associated with each host (or router) interface Interface Connection between host/router and physical link Routers typically have multiple interfaces Host typically have one or two interfaces (e.g., wired Ethernet, wireless 802.11) fi IP addressing: introduction Q) how are interfaces actually connected? → We will learn about that later For now: don’t need to worry about how one interface is connected to another (with no intervening router) Subnet What’s a subnet? Device interface that can physically reach each other without passing through an intervening router IP addresses have structure Subnet part: Devices in the same subnet have common high order bits Host part: Remaining low order bits network consisting of 3 subnets Subnet Recipe for de ning subnets Detach each interface from its host or router, creating “islands” of isolated networks Each isolated network is called a subnet Subnet mask : /24 (High-order 24 bits: subnet part of IP address) fi Subnet Recipe for de ning subnets Detach each interface from its host or router, creating “islands” of isolated networks Each isolated network is called a subnet Subnet mask : /24 (High-order 24 bits: subnet part of IP address) fi Subnets Where are the subnets? What are the /24 subnet addresses? Subnets Where are the subnets? What are the /24 subnet addresses? IP addressing: address classes 32-bit IP addresses were divided into ve subclasses fi IP addressing: address classes 32-bit IP addresses were divided into ve subclasses fi IP addressing: CIDR Classless InterDomain Routing (CIDR) Pronounced “cider” Arbitrary length is allowed for the subnet portion of address Address format: a.b.c.d/x, where x is # bits in subnet portion of address IP addresses: how to get one? That’s actually two questions How does a host get IP address within its network (host part of address)? How does a network get IP address for itself (network part of address)? IP addresses: how to get one? Q1) How does host get IP address? → Hard-coded by sysadmin in con g le (e.g., /etc/rc.con g in UNIX) → or Dynamic Host Con guration Protocol (DHCP) Dynamically get address from a server “Plug-and-play” fi fi fi fi Dynamic Host Configuration Protocol (DHCP) Goal: host dynamically obtains IP address from network server when it “joins” network Can renew its lease on address in use Allows reuse of addresses (only hold address while connected/on) Support for mobile users who join/leave network DHCP overview Host broadcast DHCP discover msg [optional] DHCP server responds with DHCP o er msg [optional] Host requests IP address using DHCP request msg DHCP server sends address via DHCP ack msg ff DHCP client-server scenario Typically, DHCP server will be co-located in router, serving all subnets to which router is attached DHCP client-server scenario DHCP client-server scenario DHCP client-server scenario DHCP client-server scenario DHCP client-server scenario DHCP: more than IP addresses DHCP can return more than just allocated IP address on subnet Address of rst-hop router for client Name and IP address of DNS server Network mask (indicating network versus host portion of address) All of these are required to configure an interface for networking !! fi DHCP example Connecting laptop will use DHCP to get IP address, address of rst-hop router, address of DNS server DHCP REQUEST message encapsulated in UDP, encapsulated in IP, encapsulated in Ethernet Ethernet frame broadcast (dest: FFFFFFFFFFFF) on LAN, received at router running DHCP server Ethernet demux’ed to IP demux’ed, UDP demux’ed to DHCP fi DHCP example DHCP server formulates DHCP ACK containing client’s IP address, IP address of rst-hop router for client, name & IP address of DNS server Encapsulated DHCP server reply forwarded to client, demuxing up to DHCP at client Client now knows its IP address, name and IP address of DNS server, IP address of its rst-hop router fi fi IP address: how to get one? Q2) How does network get subnet part of IP address? → get allocated portion of its provider ISP’s address space Hierarchical addressing: route aggregation Hierarchical addressing allows e cient advertisement of routing information Route aggregation is allowed ffi Hierarchical addressing: route aggregation Organization 1 moves from Fly-By-Night-ISP to ISPs-R-Us ISPs-R-Us now advertises a more speci c route to Organization 1 fi Hierarchical addressing: route aggregation Organization 1 moves from Fly-By-Night-ISP to ISPs-R-Us ISPs-R-Us now advertises a more speci c route to Organization 1 fi IP addressing How does an ISP get block of addresses? → Internet Corporation for Assigned Names and Numbers (ICANN, http://www.icann.org/) * Allocates IP addresses, through 5 regional registries (RRs) (who may then allocate to local registries) * Manages DNS root zone, including delegation of individual TLD (.com,.edu, …) management Are there enough 32-bit IP addresses? → ICANN allocated the last chunk of IPv4 addresses to RRs in 2011 * NAT helps IPv4 address space exhaustion * IPv6 has 128-bit address space “Who the hell knew how much address space we needed?” Vent Cerf (reflecting on decision to make IPv4 address 32 bits long) NAT & IPv6 Network Address Translation (NAT) NAT: all device in a local network share just one IPv4 address as far as outside world is concerned Network Address Translation (NAT) NAT: all device in a local network share just one IPv4 address as far as outside world is concerned Network Address Translation (NAT) All devices in a local network have 32-bit addresses in a “private” IP address space (10/8, 172.16/12, 192.168/16 pre xes) the can only be used in the local network Advantages Just one IP address needed from a provider ISP for all devices Can change addresses of hosts in the local network without notifying outside world Can change ISP without changing addresses of devices in the local network Security: devices inside the local network are not directly addressable, visible by outside world fi Network Address Translation (NAT) Two identi ers Laddr : source IP address (private IP), port # Gaddr : NAT IP address (globally routable IP), new port # Implementation: NAT router must (transparently) For outgoing datagrams, replace Laddr of every outgoing datagram to Gaddr Remote clients/servers will respond using Gaddr as destination address Maintain the translation pair of Laddr and Gaddr in the NAT translation table Replace Gaddr in the destination eld of every incoming datagram with the corresponding Laddr stored in the NAT translation table fi fi Network Address Translation (NAT) Network Address Translation (NAT) NAT has been controversial Routers should only process up to layer 3 Address “shortage” should be solved by IPv6 Violate end-to-end argument (port# manipulation by network-layer device) NAT traversal: what if client wants to connect to server behind NAT? But NAT is here to say Extensively used in home and institutional nets, 4G/5G cellular nets IPv6 motivation Initial motivation 32-bit IPv4 address space would be completely allocated Additional motivation Speed up processing/forwarding 40-byte xed length header Enable di erent network-layer treatment of “ ows” ( ow label) fl fi fl ff IPv6 datagram format What’s missing (compared with IPv4) No checksum (to speed up processing at routers) No fragmentation / reassembly No options (available at upper-layer, next-header) Extension headers IPv6 may contain zero, one, or more extension headers These headers should be presented in their recommended order IPv6 addressing IPv6 address 128 bits in length written as eight groups of four hexadecimal digits No dotted decimal representation e.g., 255.255.255.0 Rules for reduced representation Rule1: omit group of all zero The :: can only appear once in an IPv6 address Rule2: omit leading zeros IPv6 addressing IPv6 address 128 bits in length written as eight groupsCombination of four hexadecimal digits of the two rules Rules for reduced representation Rule1: omit group of all zero The :: can only appear once in an IPv6 address Rule2: omit leading zeros IPv6 addressing A few more examples for shortening addresses Match-all address (0:0:0:0 in IPv4) 0000:0000:0000:0000:0000:0000:0000:0000 → :: Loop-back address (127.0.0.1 in IPv4) 0000:0000:0000:0000:0000:0000:0000:0001 →::1 All-nodes address (224.0.0.1 in IPv4, multicast address) 02:0000:0000:0000:0000:0000:0000:0001 → 02::1 Random link-local address fe80:0000:0000:0000:0f19:1faf:008:5010 → fe80::f19:1faf:8:5010 ff ff IPv6 addressing CIDR notation for network pre x Typically, pre x lengths are multiple of four fi fi IPv6 address types Unicast An identi er for a single interface of IPv6 enabled node One-to-one communication Multicast An identi er for a set of interfaces, belonging to di erent IPv6 enabled nodes. One-to-many communication Anycast An identi er for a set of interfaces, belonging to di erent IPv6 enabled nodes. One-to-closest communication (“closest” typically means the one with the best routing metric according to the IPv6 routing protocol) No Broadcast address fi fi fi ff ff IPv6 address types 128-bit address space Link local address A special type of unicast address that is auto-con gured on any interface Enable nodes attached to a common link to communicate without the need for globally unique addresses e.g., If we connect several IPv6 enabled nodes to a switch, they will auto-con gure their interfaces with link-local address, will discover each other, and can communicate Routers do not forward packets that have a link-local source or destination addresses to other links. Auto-con guration uses a combination of the link-local pre x FE80::/10 ( rst 10 bits equal to 1111 1110 10) and the MAC address of the interface. fi fi fi fi fi Loopback address Identi es a logical interface that has no physical representation and is always up and running. Packets sent to a loopback address are returned (looped) on the same interface. In the computer world, loopback addresses are typically used for testing the TCP/IP networking stack. In IPv4, the entire network 127.0.0.0/8 address range is reserved for loopback addresses but all leading operating systems use the famous address 127.0.0.1 called "localhost" by default. The rest of the 127.0.0.0/8 address space is typically not used. In IPv6, the IPv6 address 0:0:0:0:0:0:0:1/128 (::1/128) is reserved for loopback identi er. fi fi Unspecified address Used by the operating systems in the absence of any valid IP address and processes like DHCP Typically used to indicate default routing Routers do not forward packets with source or destination address set to the unspeci ed address In IPv4, 0.0.0.0/32 In IPv6, 0:0:0:0:0:0:0:0 or completely shortened as ::/128 fi Unique local address A globally unique pre x similar to global unicast addresses. If it is accidentally leaked outside of the organization, there will be no con ict with other IPv6 global pre xes. Its structure is well-known which allows for easy ltering at site boundaries. It is an Internet Service Provider independent address space. Therefore these addresses won't overlap with any other ISP assigned range. Routers lter out any incoming or outgoing Local IPv6 unicast routes. fi fi fi fi fl Embedded IPv4-in-IPv6 A unicast address having Zeros in the rst 96-bits of the address An IPv4 address in the rightmost 32-bits e.g., IPv4 address A.B.C.D (in hex digits) is embedded in IPv6 → 0:0:0:0:0:0:A:B:C:D (or ::A:B:C:D) Used in automatic tunnels supporting both IPv4 and IPv6 protocol stacks fi Multicast address A set of interfaces can be identi ed by a single multicast address known as a multicast group In IPv4, address space of 224.0.0.0/24 is for multicast address In IPv6, a leading value of 11111111 (hex digits FF) indicates a multicast address All multicast addresses are part of the pre x 00::/8 All well-known multicast addresses start with the pre x 00::/12 Two important rules apply to IPv4 and IPv6 multicast: Packets sent to a multicast group always has a unicast source address A multicast address can not be a source address of a packet fi fi ff fi ff Solicited-node multicast address A special type of IPv6 multicast A more e cient approach to IPv4's broadcast delivery (no broadcast in IPv6) Used for address resolution, neighbor discovery, and duplicate address detection. Generated automatically using an IPv6 unicast of an interface Any unicast address has a corresponding solicited-node multicast address e.g., application for ARP service Dest. addr of the request : solicited-node multicast address of the target IPv6 address Only the target node listens to this solicited-node multicast address ffi Transition from IPv4 to IPv6 Not all routers can be upgraded simultaneously No “ ag days” Q) How will network operate with mixed IPv4 and IPv6 routers? A) Tunneling is the answer!! fl Tunneling in IPv4 and IPv6 Tunneling IPv6 datagram is carried as payload in IPv4 datagram among IPv4 routers (“packet within a packet”) Tunneling is used extensively in other context (4G/5G) Tunneling & encapsulation Tunneling & encapsulation Tunneling example Deployment of IPv6 Countries where IPv6 deployment is more widely deployed Deployment of IPv6 Google: ~45% of clients access services via IPv6 NIST: 1/3 of all US government domains are IPv6 capable h ps://www.google.com/intl/en/ipv6/sta s cs.html tt ti ti Deployment of IPv6 Google: ~45% of clients access services via IPv6 NIST: 1/3 of all US government domains are IPv6 capable Long (long!) time for deployment of new network layer Limited penetration to date In contrast, rapid deployment of new protocol at the application layer Web, messaging, streaming media, distributed game, social media, etc. Why? h ps://www.google.com/intl/en/ipv6/sta s cs.html tt ti ti Questions?

Use Quizgecko on...
Browser
Browser