Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE 4450:427/527 - Computer Networks Spring 2017

Similar presentations


Presentation on theme: "ECE 4450:427/527 - Computer Networks Spring 2017"— Presentation transcript:

1 ECE 4450:427/527 - Computer Networks Spring 2017
Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 6.2: IP Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

2 Internetworking: Discussions
For Internetworking, we shall look at few sub-problems: Interconnect links of the same type: Switches We consider an important of class switch: Bridges to interconnect Ethernet segments. We also look a way to interconnect disparate networks and links: Gateways, or now mostly known as routers. We shall focus on the IP Once we are able to interconnect a whole lot of links and networks with switches and routers, we will look at a way to find a suitable path, or route through a new working: Paths that are efficient, loop free, etc.: Routing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

3 Internetworking What is internetwork
An arbitrary collection of networks interconnected to provide some sort of host-host to packet delivery service A simple internetwork where H represents hosts and R represents routers Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

4 IP: Internet Protocol What is IP IP stands for Internet Protocol
Key tool used today to build scalable, heterogeneous internetworks It runs on all the nodes in a collection of networks and defines the infrastructure that allows these nodes and networks to function as a single logical internetwork A simple internetwork showing the protocol layers Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

5 IP: “Best Effort” Service
IP is a datagram connectionless protocol Does not provide any type of guarantee about packet delivery Out of order packet deliveries, duplicate packets, no error correction If packets are lost, IP does not try to recover or retransmit (though lower or higher layer functionalities may do so) Global addressing scheme Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

6 IPv4: Packet Format 16-bit Total Length (Bytes) 16-bit Identification
Version Header Length 8-bit Type of Service (TOS) 16-bit Total Length (Bytes) 16-bit Identification 3-bit Flags 13-bit Fragment Offset 8-bit Time to Live (TTL) 8-bit Protocol 16-bit Header Checksum 32-bit Source IP Address 32-bit Destination IP Address Options (if any) Payload Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

7 IP Packet Format Version number (4 bits) Header length (4 bits)
Indicates the version of the IP protocol Necessary to know what other fields to expect Typically “4” (for IPv4), and sometimes “6” (for IPv6) Header length (4 bits) Number of 32-bit words in the header Typically “5” (for a 20-byte IPv4 header) Can be more when “IP options” are used Type-of-Service (8 bits) Allow packets to be treated differently based on needs E.g., low delay for audio, high bandwidth for bulk transfer Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

8 IP Packet Format Total length (16 bits)
Number of bytes in the packet Maximum size is 63,535 bytes (216 -1) … though underlying links may impose harder limits Fragmentation information (32 bits) Packet identifier, flags, and fragment offset Supports dividing a large IP packet into fragments … in case a link cannot handle a large IP packet Time-To-Live (8 bits) Used to identify packets stuck in forwarding loops … and eventually discard them from the network Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

9 Time-to-Live (TTL) Potential robustness problem
Forwarding loops can cause packets to cycle forever Confusing if the packet arrives much later Time-to-live field in packet header TTL field decremented by each router on the path Packet is discarded when TTL field reaches 0… …and “time exceeded” message is sent to the source Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

10 Protocol Field Protocol (8 bits) Identifies the higher-level protocol
E.g., “6” for the Transmission Control Protocol (TCP) E.g., “17” for the User Datagram Protocol (UDP) Important for demultiplexing at receiving host Indicates what kind of header to expect next protocol=6 protocol=17 IP header IP header TCP header UDP header Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

11 IP Addresses Field Two IP addresses Destination address Source address
Source IP address (32 bits) Destination IP address (32 bits) Destination address Unique identifier for the receiving host Allows each node/router to make forwarding decisions Source address Unique identifier for the sending host Recipient can decide whether to accept packet Enables recipient to send a reply back to source Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

12 IP Fragmentation and Reassembly
Each network has some MTU (Maximum Transmission Unit): largest IP datagram it can carry in a frame Ethernet (1500 bytes), FDDI (4500 bytes) Strategy Fragmentation occurs in a router when it receives a datagram that it wants to forward over a network which has (MTU < received datagram) Reassembly is done at the receiving host All the fragments carry the same identifier in the Ident field Fragments are self-contained datagrams IP does not recover from missing fragments Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

13 IP Fragmentation and Reassembly
IP datagrams traversing the sequence of physical networks Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

14 IP Fragmentation and Reassembly
Header fields used in IP fragmentation. (a) Unfragmented packet; (b) fragmented packets. Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

15 IP Datagram Forwarding
Strategy every datagram contains destination's address if directly connected to destination network, then forward to host if not directly connected to destination network, then forward to some router forwarding table maps network number into next hop each host has a default router each router maintains a forwarding table Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

16 Forwarding Table Dr. Nghi Tran (ECE-University of Akron)

17 IPv4 Addressing A unique 32-bit number Identifies an interface (on a host, on a router, …) Represented in dotted-quad notation 12 34 158 5 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

18 IPv4 Addressing A host usually has a single link into network: When IP in host wants to send datagram, it does so over the link -> Boundary between host and link: interface. IP address: technically associated with an interface, rather with the host How about a router? Receive datagram on a link and forward to on some other link. How many interfaces? How many IP addresses? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

19 IPv4: Early Addressing Properties Format Dot notation globally unique
hierarchical: network + host 4 Billion IP address, half are A type, ¼ is B type, and 1/8 is C type Format Dot notation Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

20 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 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

21 Subnets IP address: What’s a subnet ? subnet part (high order bits)
host part (low order bits) What’s a subnet ? device interfaces with same subnet part of IP address can physically reach each other without intervening router subnet network consisting of 3 subnets Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

22 Subnet and Subnet Mask Recipe
/24 /24 /24 Recipe to determine the subnets, detach each interface from its host or router, creating islands of isolated networks each isolated network is called a subnet. Subnet mask: /24 Or Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

23 Subnets How many? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

24 ARP: Address Resolution Protocol
Question: how to determine MAC address of B knowing B’s IP address? Each IP node (host, router) on LAN has ARP table in ARP module ARP table: IP/MAC address mappings for some LAN nodes < IP address; MAC address; TTL> TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) 1A-2F-BB AD LAN 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

25 ARP: Same LAN ARP is “plug-and-play”:
A wants to send datagram to B, and B’s MAC address not in A’s ARP table. A broadcasts ARP query packet, containing B's IP address dest MAC address = FF-FF-FF-FF-FF-FF 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) ARP is “plug-and-play”: nodes create their ARP tables without intervention from net administrator Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

26 ARP: Packet Format HardwareType: type of physical network (e.g., Ethernet) ProtocolType: type of higher layer protocol (e.g., IP) HLEN & PLEN: length of physical and protocol addresses Operation: request or response Source/Target Physical/Protocol addresses Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

27 Addressing: Routing to another LAN
walkthrough: send datagram from A to B via R. focus on addressing - at both IP (datagram) and MAC layer (frame) assume A knows B’s IP address How can A know whether B is in the same subnet/network? assume A knows B’s MAC address (how?) assume A knows IP address of first hop router, R (how?) assume A knows MAC address of first hop router interface (how?) – How many MAC addresses? 49-BD-D2-C7-56-2A 88-B2-2F-54-1A-0F B A R C-E8-FF-55 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

28 Addressing: Routing to another LAN
A creates IP datagram with IP source A, destination B A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram MAC src: C-E8-FF-55 MAC dest: E6-E BB-4B IP Eth Phy IP src: IP dest: 49-BD-D2-C7-56-2A 88-B2-2F-54-1A-0F B A R C-E8-FF-55 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

29 Addressing: Routing to another LAN
frame sent from A to R frame received at R, datagram removed, passed up to IP MAC src: C-E8-FF-55 MAC dest: E6-E BB-4B IP Eth Phy IP src: IP dest: IP Eth Phy 49-BD-D2-C7-56-2A 88-B2-2F-54-1A-0F B A R C-E8-FF-55 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

30 Addressing: Routing to another LAN
R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy IP src: IP dest: IP Eth Phy 49-BD-D2-C7-56-2A 88-B2-2F-54-1A-0F B A R C-E8-FF-55 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

31 Addressing: Routing to another LAN
R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram IP src: IP dest: MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP Eth Phy IP Eth Phy 49-BD-D2-C7-56-2A 88-B2-2F-54-1A-0F B A R C-E8-FF-55 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

32 Addressing: Routing to another LAN
R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP src: IP dest: IP Eth Phy 49-BD-D2-C7-56-2A 88-B2-2F-54-1A-0F B A R C-E8-FF-55 1A-23-F9-CD-06-9B E6-E BB-4B CC-49-DE-D0-AB-7D Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

33 IP Addresses: How to get one?
MAC address: configured in adapter, globally unique IP address: Not only be unique on a given internetwork, but needs to reflect the structure of the internetwork Not possible to be configured once into host; Hosts might change to another network: IP needs to be reconfigurable Usually, automatic configuration methods are required: Dynamic Host Configuration Protocol (DHCP): Textbook, 3.2.7 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

34 A day in the life: Connecting to Internet
browser DNS server Comcast network /13 school network /24 web page web server Google’s network /19 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

35 A day in the life: Connecting to Internet
DHCP UDP IP Eth Phy DHCP DHCP connecting laptop needs to get its own IP address, addr of first-hop router, addr of DNS server: use DHCP DHCP DHCP request encapsulated in UDP, encapsulated in IP, encapsulated in Ethernet DHCP DHCP UDP IP Eth Phy DHCP router (runs DHCP) Ethernet frame broadcast (dest: FFFFFFFFFFFF) on LAN, received at router running DHCP server Ethernet demuxed to IP demuxed, UDP demuxed to DHCP Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

36 A day in the life: Connecting to Internet
DHCP DHCP UDP IP Eth Phy DHCP server formulates DHCP ACK containing client’s IP address, IP address of first-hop router for client, name & IP address of DNS server encapsulation at DHCP server, frame forwarded (switch learning) through LAN, demultiplexing at client DHCP UDP IP Eth Phy DHCP DHCP router (runs DHCP) DHCP client receives DHCP ACK reply DHCP Client now has IP address, knows name & addr of DNS server, IP address of its first-hop router Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

37 A day in the life: ARP (before DNS, HTTP)
before sending HTTP request, need IP address of DNS DNS UDP IP Eth Phy DNS ARP ARP query DNS query created, encapsulated in UDP, encapsulated in IP, encapsulated in Eth. In order to send frame to router, need MAC address of router interface: ARP Eth Phy ARP ARP reply ARP query broadcast, received by router, which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router, so can now send frame containing DNS query Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

38 NAT All datagrams leaving local Datagrams with source or
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) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

39 NAT 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 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

40 WAN side addr LAN side addr
NAT 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 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

41 NAT: Network Address Translation
NAT is controversial: routers should only process up to layer 3 violates end-to-end argument: Hosts should be talking directly with each other, without interfereing nodes modifying IP addresses and port numbers Address shortage should instead be solved by IPv6 But like it or not, NAT becomes an important component of the Internet Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527


Download ppt "ECE 4450:427/527 - Computer Networks Spring 2017"

Similar presentations


Ads by Google