1 IP: putting it all together Part 1 G53ACC Chris Greenhalgh.

Slides:



Advertisements
Similar presentations
21.1 Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Advertisements

Internet Control Protocols Savera Tanwir. Internet Control Protocols ICMP ARP RARP DHCP.
 As defined in RFC 826 ARP consists of the following messages ■ ARP Request ■ ARP Reply.
Week 5: Internet Protocol Continue to discuss Ethernet and ARP –MTU –Ethernet and ARP packet format IP: Internet Protocol –Datagram format –IPv4 addressing.
Network Layer introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol  datagram format  IPv4.
Chapter 5 The Network Layer.
11- IP Network Layer4-1. Network Layer4-2 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection.
Oct 21, 2004CS573: Network Protocols and Standards1 IP: Addressing, ARP, Routing Network Protocols and Standards Autumn
IP Routing: an Introduction. Quiz
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
Network Layer4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side,
IP Address 0 network host 10 network host 110 networkhost 1110 multicast address A B C D class to to
1 Internet Control Message Protocol (ICMP) RIZWAN REHMAN CCS, DU.
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
1 TCP/IP architecture A set of protocols allowing communication across diverse networks Out of ARPANET Emphasize on robustness regarding to failure Emphasize.
Lecture 8 Modeling & Simulation of Communication Networks.
IST 228\Ch3\IP Addressing1 TCP/IP and DoD Model (TCP/IP Model)
Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.
TCP/IP Protocol Suite 1 Chapter 6 Upon completion you will be able to: Delivery, Forwarding, and Routing of IP Packets Understand the different types of.
TCP/IP Networking sections 13.2,3,4,5 Road map: TCP, provide connection-oriented service IP, route data packets from one machine to another (RFC 791) ICMP,
IP (Internet Protocol) –the network level protocol in the Internet. –Philosophy – minimum functionality in IP, smartness at the end system. –What does.
Network Layer – Subnetting and Control Protocols Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing,
1 Computer Communication & Networks Lecture 20 Network Layer: IP and Address Mapping (contd.) Waleed.
Adapted from: Computer Networking, Kurose/Ross 1DT066 Distributed Information Systems Chapter 4 Network Layer.
1 IP: putting it all together Part 2 G53ACC Chris Greenhalgh.
1 IP Forwarding Relates to Lab 3. Covers the principles of end-to-end datagram delivery in IP networks.
Examining TCP/IP.
Copyright © Lopamudra Roychoudhuri
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
1 Chapter 4: Network Layer r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Hierarchical routing.
Fall 2005Computer Networks20-1 Chapter 20. Network Layer Protocols: ARP, IPv4, ICMPv4, IPv6, and ICMPv ARP 20.2 IP 20.3 ICMP 20.4 IPv6.
Suez Canal University – Faculty of Computers & Informatics - Cisco Local Academy Network Fundamentals.
Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
1 TCP/IP Networking. 2 TCP/IP TCP/IP is the networking protocol suite most commonly used with UNIX, Windows, NT and most other OS’s. TCP/IP defines a.
Chapter 81 Internet Protocol (IP) Our greatest glory is not in never failing, but in rising up every time we fail. - Ralph Waldo Emerson.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
Microsoft Windows Server 2003 TCP/IP Protocols and Services Technical Reference Slide: 1 Lesson 7 Internet Protocol (IP) Routing.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
Network Layer4-1 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection RIP, OSPF, BGP IP protocol.
Transport Layer3-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
Network Layer4-1 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”
1 Requirements for Internet Routers (Gateways) and Hosts Relates to Lab 3. (Supplement) Covers the compliance requirements of Internet routers and hosts.
1 Bus topology network. 2 Data is sent to all computers, but only the destination computer accepts 02608c
Linux Operations and Administration Chapter Eight Network Communications.
The Internet Network layer
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 19 Omar Meqdadi Department of Computer Science and Software Engineering University.
1 Chapter 4: Internetworking (Internet Protocol) Dr. Rocky K. C. Chang 16 March 2004.
1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016.
IP Internet Protocol. IP TCP UDP ICMPIGMP ARP PPP Ethernet.
UDP. User Datagram Protocol (UDP)  Unreliable and unordered datagram service  Adds multiplexing  No flow control  Endpoints identified by ports 
Internet Control Message Protocol (ICMP)
© 2003, Cisco Systems, Inc. All rights reserved.
Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed.
Internet Control Message Protocol (ICMP)
IP: Addressing, ARP, Routing
Chapter 4: Network Layer
A Typical Connection Scenario
Internet Control Message Protocol (ICMP)
IP - The Internet Protocol
Net 323: NETWORK Protocols
Internet Control Message Protocol (ICMP)
IP Forwarding Relates to Lab 3.
CS 457 – Lecture 10 Internetworking and IP
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP)
Wide Area Networks and Internet CT1403
IP Forwarding Relates to Lab 3.
Presentation transcript:

1 IP: putting it all together Part 1 G53ACC Chris Greenhalgh

2 Contents l Scenario l Local network communication –Sending a packet –ARP –Receiving a packet l Remote network communication –Routing

3 Book coverage l Assumed from CCN: –Comer ch. 13 (routing), 17 (internet), 22 (IPv6), 25 (TCP) l Reviewed: –Comer ch. 18 (addresses), 20 (datagram), 21 (frag.) l Additional: –Comer ch. 19 (ARP), 23 (ICMP), 24 (UDP), 26 (NAT), 27 (Internet routing, part)

4 Scenario l Sending a UDP packet –E.g. the ReverseClientUnicast, or DNS client l Pre-configured machine l On an Ethernet l Connected to the Internet l Running the IP protocol suite –How does communication "really" work?

5 Scenario (& see text dump) (monet) (mcclean) (DNS server) Router Ethernet switch(es) / / ( Internet Start Here 

6 e.g. ReverseClientUnicast.java l … int port = Integer.parseInt(args[1]); InetAddress server = InetAddress.getByName(args[0]); DatagramSocket socket = new DatagramSocket(); … byte [] data = requestByteStream.toByteArray(); DatagramPacket request = new DatagramPacket(data, data.length, server, port); socket.send(request); …

7 TCP/IP reference model IEEE802 Ethernet, WiFi, … IP TCP, UDP Comer Fig ReverseClient, DNS, … You are here

8 What have you got? (what does the machine know?) l An array of bytes –Application layer data l A destination IP address (not name) –E.g (case 1); (case 2) l A destination UDP port l A sending UDP socket (=> source UDP port) l Local IP configuration (in OS) –See later

9 Goal: send that data to the destination machine l But physical network transports Ethernet frames (only!)… You are here: Application Data

10 Transport layer, UDP: add UDP header l Source port = sending socket l Dest. port = from request l Data = app. Data l Length = data length l Checksum = error check (CRC)

11 TCP/IP reference model IEEE802 Ethernet, WiFi, … IP TCP, UDP Comer Fig ReverseClient, DNS, … You are here

12 What have you got now? (what does the machine know?) l A UDP header and datagram payload –Includes source & dest. UDP ports –Application layer data l A destination IP address (not name) –E.g (case 1); (case 2) l Local IP configuration (in OS) –See later

13 Network Layer, IP: add IP header

14 Selected IP header fields l Version = 4 l Type = UDP l Source IP address = a local IP, probably not filled in yet l Destination IP = from request l TTL = “Time To Live” (network hops), initially high l Header checksum = error check for header l Fragment offset – see fragmentation

15 So… l You have: –IP packet –With IP destination l You need: –Ethernet (or other network) Interface to send it –Ethernet frame –With Ethernet destination

16 Local IP configuration l For now assume set by hand, e.g. on monet: –Own IP address, e.g –Netmask (range of IP addresses on physical segment), e.g –Default router, e.g –DNS server address –(See later notes on auto-configuration) l Built in: –Own Ethernet address (in Network Interface Card (NIC) PROM)

17 IP layer: what shall I do with this packet? l IP datagram forwarding rule: –Send it to another physically reachable machine which is believed to be closer to the IP destination l But: –Which machine is closer? –Which physical interface can be used to reach that machine? l  Consult OS IP routing table…

18 Routing table l Lists a set of rules: l  What to do with a packet addressed to any destination IP address –Which physical interface to use –Whether the destination is directly reachable –If not, which directly reachable machine to pass the packet on to

19 Routing table example (from scenario, monet) # netstat -r Destination Gateway Genmask Fl M R U Iface U eth U lo UG eth0 # ifconfig eth0 [windows: ipconfig /all] eth0 Link encap:Ethernet HWaddr 00:01:02:AD:0F:08 inet addr: Bcast: Mask: UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 # netstat -r Destination Gateway Genmask Fl M R U Iface U eth U lo UG eth0 # ifconfig eth0 [windows: ipconfig /all] eth0 Link encap:Ethernet HWaddr 00:01:02:AD:0F:08 inet addr: Bcast: Mask: UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 G = gateway (not direct)

20 Routing table example: windows ( not from the scenario) l >netstat –r Network Destination Netmask Gateway Interface Metric l l l l l … l >ipconfig /all l … l Ethernet adapter Local Area Connection: l Connection-specific DNS Suffix. : l Description : 3Com Gigabit NIC (3C2000) l Physical Address : 00-0A-5E-54-2B-65 l IP Address : l Subnet Mask : l … This machine (direct)

21 Case 1: send to (monet) (mcclean) (DNS server) Router Ethernet switch(es) / / ( Internet Start Here 

22 Case 1: Send to l Find routing table entry matching destination IP address ( ) l  gateway (if any) and interface –No gateway (directly reachable destination)  send directly to –Interface “eth0” l Need Ethernet address for direct destination to send on Ethernet…

23 Address Resolution Protocol (ARP) l Internet standard, RFC 826 l Protocol for dynamic mapping of (local) IP addresses to (local) Ethernet address

24 ARP request/response packet l Construct ARP request “who has IP ”: –“H” = “hardware” (Ether.); “P” = “protocol” (IP)

25 ARP/Ethernet encapsulation l Place ARP request in Ethernet frame –Type 806

26 ARP query l Broadcast on identified outgoing interface: Broadcast request Unicast response

27 ARP query handling –all hosts on that Ethernet receive the broadcast request and packet to OS –Each host inspects Ethernet frame type and passes to relevant handler (in OS) –ARP handler inspects request: is this my IP address? –Host sees match and builds and sends back ARP response “ = Ethernet address 0 0:a0:c9:ca:1d:d7” –Sending host caches this information for (near) future re-use in an ARP table…

28 ARP cache Try # arp –a Try # arp –a –table of IP address  Ethernet (MAC) address

29 TCP/IP reference model IEEE802 Ethernet, WiFi, … IP TCP, UDP Comer Fig ReverseClient, DNS, … You are here

30 (Finally) Build Ethernet frame l Source IP = sending interface IP l Source MAC address = sending interface MAC address l Destination IP address = original destination l Destination MAC address = next hop MAC address l Ethernet frame type = 0800

31 Send on identified network interface l Ethernet LAN is (logical) broadcast –Packet typically seen by the Ethernet card of every machine on that LAN l (give or take Ethernet switches which learn and route by MAC address)

32 Receiving a packet…

33 Incoming Ethernet frame: NIC l Check dest. Ethernet (MAC) address –Accept if broadcast or = NIC’s MAC address –Interrupt OS…

34 Incoming Ethernet frame: OS l OS is interrupted by NIC and retrieves received Ethernet frame l Inspects frame type field and handles contents (payload) accordingly: –0806  ARP (already considered) –0800  IP v.4…

35 Incoming IP packet (OS) l Inspects IP header –Check header checksum, discard if corrupted –Check destination IP address l If (one of our) local address(es), continue local processing… l Otherwise, consider for forwarding –Forwarding enabled (e.g. router)  see later –Forwarding disabled (e.g. most hosts)  discard

36 Incoming IP packet with local destination (OS) l (Fragments reassembled first – see later) l Check IP packet type: –1 ICMP Internet Control Message –2 IGMP Internet Group Management –4 IP in IP (encapsulation) –6 TCP Transmission Control –17 UDP User Datagram l Pass to relevant handler…

37 Incoming (e.g.) UDP datagram with local IP address (OS) l Inspects UDP header –Check UDP checksum, discard if corrupt –Check destination UDP port l If not bound to an application  Send an error response (ICMP Destination Unreachable – see later) l If currently bound to an application socket  pass payload plus source IP and source UDP port to application socket…

38 Receiving application (e.g. ReverseServerUnicast.java) l int port = Integer.parseInt(args[0]); DatagramSocket socket = new DatagramSocket(port); … byte [] requestBytes = new byte[65536]; DatagramPacket request = new DatagramPacket(requestBytes, requestBytes.length); socket.receive(request); … l int port = Integer.parseInt(args[0]); DatagramSocket socket = new DatagramSocket(port); … byte [] requestBytes = new byte[65536]; DatagramPacket request = new DatagramPacket(requestBytes, requestBytes.length); socket.receive(request); …

39 Case 2: send to (different network) (monet) (mcclean) (DNS server) Router Ethernet switch(es) / / ( Internet Start Here 

40 Case 2: Send to l Begins as before: –Construct UDP header –Construct IP header –  Complete IP datagram

41 Case 2: Routing at sender l Find routing table entry matching destination IP address ( ) (may appear as “default”): # netstat -r Destination Gateway Genmask Fl M R U Iface U eth U lo UG eth0 l Doesn't match local network, So use default route –Gateway (next directly reachable hop) = router –Outgoing network interface = eth0 (IP ) G = gateway (not direct)

42 Case 2: Sending non-local l Destination IP address is l Destination Ethernet address is Ethernet address of gateway/next hop machine –  do ARP to find Ethernet address corresponding to IP –Router replies with its MAC address on that LAN l Send IP packet in Ethernet frame on LAN to router MAC address…

43 Routing handling of packet l Initially as for normal host receive –NIC accepts Ethernet frame addressed to it –Passes to OS via interrupt –OS determines frame type and passes for handling as IP –Checks packet is not corrupt –Checks destination IP address l If local, continue processing for local delivery l If not local…

44 Router packet forwarding l OS checks packet Time To Live (TTL) –may discard packet, else decrement TTL l Now send as a normal packet –router OS checks own routing tables l finds next hop IP destination for network portion of IP address –resolves low-level address of next hop (e.g. Ethernet, using ARP) –sends packet on next hop interface

45 Routing in routers l Routers are pre-configured with details of directly connected networks l Routers exchange routing packets with all directly connected routers –e.g. RIP, BGP, OSPF l Routers progressively discover all networks and which interface is "closest" to them, i.e. what the next hop interface should be.

46 Wide-area routing l For scalability (localisation of information) routing is normally divided: –Within a site or organisation = “autonomous unit” –Between autonomous units Note: different protocols, different levels of granularity