Overview of TCP/IP Protocols

Slides:



Advertisements
Similar presentations
CPSC Network Layer4-1 IP addresses: how to get one? Q: How does a host get IP address? r hard-coded by system admin in a file m Windows: control-panel->network->configuration-
Advertisements

IPv4 - The Internet Protocol Version 4
Network Layer IPv6 Slides were original prepared by Dr. Tatsuya Suda.
21.1 Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
ARP: Address Resolution Protocol
Special IP Addresses All 0’s – this computer on bootstrap Network.000s – id’s the network Network.111s – broadcast – broadcast 127.x loopback 6/9/2015ICSS420.
Chapter 5 The Network Layer.
Oct 21, 2004CS573: Network Protocols and Standards1 IP: Addressing, ARP, Routing Network Protocols and Standards Autumn
1 Application TCPUDP IPICMPARPRARP Physical network Application TCP/IP Protocol Suite.
ITIS 6167/8167: Network and Information Security Weichao Wang.
Chapter 3 Review of Protocols And Packet Formats
IP Address 0 network host 10 network host 110 networkhost 1110 multicast address A B C D class to to
IST 228\Ch3\IP Addressing1 TCP/IP and DoD Model (TCP/IP Model)
21.1 Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
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,
TELE202 Lecture 10 Internet Protocols (2) 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »Internet Protocols (1) »Source: chapter 15 ¥This Lecture »Internet.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 03_a
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.
COMT 429 The Internet Protocols COMT 429. History 1969First version of a 4 node store and forward network, the ARPAnet 1972Formal demonstration of ARPAnet.
1 Internet Protocol. 2 Connectionless Network Layers Destination, source, hop count Maybe other stuff –fragmentation –options (e.g., source routing) –error.
1 IP: putting it all together Part 1 G53ACC Chris Greenhalgh.
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol.
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.
TCP/IP TCP/IP LAYERED PROTOCOL TCP/IP'S APPLICATION LAYER TRANSPORT LAYER NETWORK LAYER NETWORK ACCESS LAYER (DATA LINK LAYER)
Suez Canal University – Faculty of Computers & Informatics - Cisco Local Academy Network Fundamentals.
ECE 526 – Network Processing Systems Design Networking: protocols and packet format Chapter 3: D. E. Comer Fall 2008.
Hyung-Min Lee ©Networking Lab., 2001 Chapter 8 ARP and RARP.
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.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
1 Network Layer Lecture 15 Imran Ahmed University of Management & Technology.
1 CS 4396 Computer Networks Lab TCP/IP Networking An Example.
1 Network Layer Lecture 16 Imran Ahmed University of Management & Technology.
IP Addresses Universal address regardless of layer 2 architecture Each address is that of an interface, not necessarily a host A host may have more than.
Communications Services Connection Oriented Service  A connection is established  Data is sent or received over this connection  Connection may be terminated.
CSC 600 Internetworking with TCP/IP Unit 5: IP, IP Routing, and ICMP (ch. 7, ch. 8, ch. 9, ch. 10) Dr. Cheer-Sun Yang Spring 2001.
1 Kyung Hee University Chapter 8 ARP(Address Resolution Protocol)
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.
1 Connectivity with ARP and RARP. 2 There needs to be a mapping between the layer 2 and layer 3 addresses (i.e. IP to Ethernet). Mapping should be dynamic.
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 19 Omar Meqdadi Department of Computer Science and Software Engineering University.
1 Internetworking: IP Packet Switching Reading: (except Implementation; pp )
© Jörg Liebeherr (modified by M. Veeraraghavan) 1 Point-to-Point Protocol Data Link Layer Loopback ARP and RARP.
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.
Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Packet Switch Network Server client IP Ether IPTCPData.
IP - Internet Protocol No. 1  Seattle Pacific University IP: The Internet Protocol Kevin Bolding Electrical Engineering Seattle Pacific University.
© 2003, Cisco Systems, Inc. All rights reserved.
Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed.
IP: Addressing, ARP, Routing
Scaling the Network: The Internet Protocol
Chapter 8 ARP(Address Resolution Protocol)
Objective: ARP.
ARP and RARP Objectives Chapter 7 Upon completion you will be able to:
TCP/IP Transmission Control Protocol / Internet Protocol
Net 323: NETWORK Protocols
CS 457 – Lecture 10 Internetworking and IP
Some slides have been taken from:
ARP: Address Resolution Protocol
Wide Area Networks and Internet CT1403
Guide to TCP/IP, Third Edition
IP Forwarding Relates to Lab 3.
1 ADDRESS RESOLUTION PROTOCOL (ARP) & REVERSE ADDRESS RESOLUTION PROTOCOL ( RARP) K. PALANIVEL Systems Analyst, Computer Centre Pondicherry University,
ARP: Address Resolution Protocol
Scaling the Network: The Internet Protocol
Ch 17 - Binding Protocol Addresses
16EC Computer networks unit II Mr.M.Jagadesh
Presentation transcript:

Overview of TCP/IP Protocols Computer Network Programming

32 bit destination IP address IP Protocol Header Version Hdr length Type of service Total length identification flags Fragment offset 20 byte Header Time to leave protocol Header checksum 32 bit source IP address 32 bit destination IP address Options (if any) Data

Header length is the number of 32 bits in the header Version is 4 (IPv4) Header length is the number of 32 bits in the header Type of service field is used to assign priorities to the packets Total length field is the total length of an IP packet (max 65535). Identification field identifies each IP packet sent. It is used in fragmentation. Time-to-live field limits the lifetime of an IP packet Each router decrements it.

Protocol field is used to demultiplex the incoming packet to the appropriate upper layer: TCP, UDP. Header checksum is calculated over the header to check the integrity of the header. Source IP address is the IP address of the sending machine. Destination IP address is the IP address of the receiving machine. Options field can keep additional information. It is optional.

IPv6 IPv4 address space is limited and can not support the ever increasing number of hosts in the Internet in the future. IPv4 does not support Quality of Service Ipv6 has more clean and efficient header IETF developed IPv6 to address these problems IPv6 is not globally operational. IPv4 is used in most places. But islands of IPv6 networks exists.

128 bit Destination Address IPv6 Header Version Traffic Class Flow Label Payload length Next Header Hop Limit 128 bit Source Address 128 bit Destination Address

Version: 6 for IPv6. Traffic Class: identifies different classes and priorities Flow Label: used by the source to label the packets that makes a stream from source to destination Payload Length: the length of the data portion. Next Header: identifies the type of the header that is immediately used after the IPv6 header: TCP, UDP.. Hop Limit: decremented by 1 by each router that forwards the packet. If reaches to zero, then the packet is discarded.

Other Protocols API TCP UDP IP IGMP ICMP ARP RARP Application layer User level Processes User process User process User process User process API Transport layer TCP UDP Network layer IP IGMP ICMP Kernel Link layer ARP Hardware İnterface Ethernet/PPP/... RARP Physical Media (Ethernet cable, serial line, ….)

Operating System Kernel Applications (User level Processes) Process 1 Process 2 Process N Operating System Kernel TCP/IP protocols are implemented inside the kernel HW

Demultiplexing Appl. Appl. Appl. Appl. TCP UDP ICMP IGMP IP ARP RARP Demultiplexing based on port number in TCP/UDP header TCP UDP ICMP IGMP Demultiplexing based on protocol number in IP header IP ARP RARP Demultiplexing based on frametype in the ethernet header Ethernet Driver Incoming frame

Link Layer Two examples of different link layer protocols Ethernet PPP protocol that is used in local area networks (for example in the network in dormitories and departments shared pysical link responsible from framing. implements a MAC protocol PPP the protocol that is used over telephone lines/serial lines at your home while getting connected to Internet from home dedicated physical link no MAC protocol is needed. Responsible from framing of IP datagrams (packets) over byte stream oriented serial lines.

IP Internet TCP IP IP Telephone network TCP IP Ethernet Ethernet PPP Bilkent Web Server at the University Web Server Bilkent Campus Router TCP Your computer at home IP IP Ethernet Ethernet Web Browser Wide area connectivity Local Area Network at School Internet TCP ISP router IP IP PPP PPP Serial line Telephone network modem modem Wide area connectivity Telephone lines ISP: Internet service provider

Ethernet 6 bytes 6 2 46-1500 bytes 4 0800 IP datagram 0806 ARP packet 6 2 46-1500 bytes 4 dst address src address type data CRC 0800 IP datagram 0806 ARP packet 8035 RARP packet Dst and Src addresses are 6 bytes MAC addresses. They are globally unique. Example: 00:0e:63:93:2e:86 MTU (maximum tranferable unit) is 1500 bytes. IP packet should be fragmented to that size if they are larger than 1500 bytes.

PPP 1 1 1 2 <= 1500 2 1 data 0021 IP datagram Flag 0x7E Addr 0xFF control 0x03 Protocol data CRC Flag 0x7E 0021 IP datagram C021 Link control packet 8021 Network control packet All occurances of 0x7E is byte stuffed: replaced with 0x7d 0x5e 0x7d is transmitted as 2 byte sequence 0x7d 0x5d. MTU is 1500, but can be negotiated Connection oriented protocol: a PPP connection is established before you send data. That is why you are waiting for some time when connecting from home. Dialing time + PPP connection time

Loopback Interface There is an other interface on every computer which is loopback. Its IP address is always 127.0.0.1 It does not have any hardware attached to it. If you send data to this address, data comes back to your computer: so it is loopback. IP loopback ethernet 127.0.0.1/8

Network interfaces You can have multiple network interfaces in your computer: loopback, ethernet interface, token ring interface…. You will have an IP address and subnet mask configured for each interface. Those machines that have more than one physical network interface are called multihomed machines.

ifconfig commad You can use ifconfig command to see the configured interfaces in a UNIX machine (ipconfig for WINDOWS). You use the same command to configure/modify the properties of an interface (assign IP address/subnet mask etc.) ifconfig -a gives all the configured interfaces example: lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232 inet 127.0.0.1 netmask ff000000 le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500 inet 139.179.21.217 netmask ffffff00 broadcast 139.179.21.255 Two interfaces are configures for this machine: loopback and an ethernet interface. ifconfig le0 gives information only on interface le0.

netstat command netstat command gives information about the network connections that the machine has currently, the routing table content etc. It is a command that displays the content of various network related data structures in the kernel. netstat -nr shows the content of the routing table on that machine Example: aspendos{korpe}:> netstat -nr Routing Table: Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------- 139.179.21.0 139.179.21.217 U 3 924 le0 224.0.0.0 139.179.21.217 U 3 0 le0 default 139.179.21.240 UG 0 851 127.0.0.1 127.0.0.1 UH 0 63282 lo0

Delivery of IP datagrams at the Link layer 129.192.56.10 Internet S The frames in a LAN are sent to each other using MAC addresses as the identities of the hosts. Packets are coming for C (dst IP address = 139.179.10.6) c Router R 139.179.10.1 IP address of R 00:0e:63:93:2e:86 MAC address of R LAN(Ethernet) 00:00:20:79:04:14 A B C D 139.179.10.6

Use of MAC (link layer) addresses When stations in a shared LAN send frames(packets) to eachother, they use the MAC addresses (link layer addresses) as the destination address of the frames For example, route R will put the IP packet inside an ethernet frame while sending the packet to host C. the ethernet frame will contain the MAC address of C as in its dst address field When host A (or B etc.) want to send an IP packet to C, it does the same thing. All stations in a LAN talk to eachother using their MAC addresses.

The IP packets that is send from Router R to C will be (assume the packets are originated at computer S) like the following: IP packet will be put into an Ethernet frame: Ethernet frame that is originated at router R and destined to C Src addr Type Dst addr 00:00:20:79:04:14 00:0e:63:93:2e:86 0x800 IP datagram CRC Src address Dst address 129.192.56.10 139.179.10.6 data Other fields of IP hdr

Address resolution Assume in a LAN a host want to send a frame to the other host on the same LAN. How does the sender host knows the Ethernet address of the receiving host? We need an address resolution protocol

A C B R D E F A wants to send a frame to E (it can also be router R) A will build an ethernet frame but it does not know the MAC addres of E. Address Resolution Protocol (ARP): provides mapping from IP addresses to MAC addresses.

ARP and RARP IP Address MAC Address ARP RARP RARP: reverse address resolution protocols.

How does ARP work Host that want to send a frame, broadcasts an ARP request packet on the LAN The broadcast address is ff:ff:ff:ff:ff:ff (this will be the dst address field in ethernet frame) The ARP packet contains the IP address that host wants the MAC address for. All hosts on the LAN receive the ARP request packet.

ARP The destination host that has the IP address matching the IP address in the ARP request packet, replies back to the sending host with a ARP replay packet and includes its MAC address in the packet. The sending host takes the unicast reply and learns the MAC address of the destination Note that the ARP reply is not broadcasted but directly sent to the sender of the ARP request packet.

ARP Cache When the sender host learns the MAC address of the receiver host, it stores this mapping in its cache (ARP table). All subsequent frames that are destined to this host use this MAC address (without invoking the ARP protocol) The mapping is stored for some period of time (like 20 minutes) and then deleted.

arp command arp allows you to display and modify (if you are a superuser in UNIX) the ARP table arp -a shows the content of the table aspendos{korpe}:> arp -a Net to Media Table Device IP Address Mask Flags Phys Addr ------ -------------------- --------------- ----- --------------- le0 hitit 255.255.255.255 00:40:61:00:3e:2a le0 cisco3 255.255.255.255 00:e0:63:93:2e:86 le0 gordion 255.255.255.255 08:00:20:79:04:14 le0 pcmfbe.ef.bilkent.edu.tr 255.255.255.255 00:05:1c:01:d1:28 le0 139.179.54.1 255.255.255.255 00:e0:63:93:2e:86 le0 best.ee.bilkent.edu.tr 255.255.255.255 00:40:61:00:0d:c2 le0 didim.ee.bilkent.edu.tr 255.255.255.255 08:00:20:73:99:b6 le0 ph-mali.bcc.bilkent.edu.tr 255.255.255.255 00:e0:63:93:2e:86 le0 139.179.13.1 255.255.255.255 00:e0:63:93:2e:86 le0 pcscanner 255.255.255.255 00:80:ad:b7:c3:34

Sender Sender IP address ARP Packet format Ether dst addess 6 bytes Ethernet Header Ether src addess 6 Ether frame type 2 Hw type 2 Prot Type 2 ARP request/reply packet format Hw Size 1 Proto Size 1 6 Sender Ether address 4 Sender Sender IP address Target Ether address 6 Target IP address 4

Example - ARP request Host 139.179.137.84 wants to learn the MAC Frame 5 (42 on wire, 42 captured) Arrival Time: Feb 19, 2002 22:48:18.612874000 Time delta from previous packet: 1.356006000 seconds Time relative to first packet: 5.372405000 seconds Frame Number: 5 Packet Length: 42 bytes Capture Length: 42 bytes Ethernet II Destination: ff:ff:ff:ff:ff:ff (ff:ff:ff:ff:ff:ff) Source: 08:00:46:48:43:9f Type: ARP (0x0806) Address Resolution Protocol (request) Hardware type: Ethernet (0x0001) Protocol type: IP (0x0800) Hardware size: 6 Protocol size: 4 Opcode: request (0x0001) Sender hardware address: 08:00:46:48:43:9f Sender protocol address: 139.179.137.84 Target hardware address: 00:00:00:00:00:00 Target protocol address: 139.179.137.1 Host 139.179.137.84 wants to learn the MAC address of the router whose IP address is 139.179.137.1

Example continued - ARP reply Frame 6 (60 on wire, 60 captured) Arrival Time: Feb 19, 2002 22:48:18.613552000 Time delta from previous packet: 0.000678000 seconds Time relative to first packet: 5.373083000 seconds Frame Number: 6 Packet Length: 60 bytes Capture Length: 60 bytes Ethernet II Destination: 08:00:46:48:43:9f Source: 00:e0:63:90:b7:9a (CABLETRO_90:b7:9a) Type: ARP (0x0806) Trailer: 00000000000000000000000000000000... Address Resolution Protocol (reply) Hardware type: Ethernet (0x0001) Protocol type: IP (0x0800) Hardware size: 6 Protocol size: 4 Opcode: reply (0x0002) Sender hardware address: 00:e0:63:90:b7:9a Sender protocol address: 139.179.137.1 Target hardware address: 08:00:46:48:43:9f Target protocol address: 139.179.137.84 Answer comes here

RARP protocol A diskless system like an X-terminal want to learn its IP address automatically when booted. It sends an RARP request, requesting the IP address corresponding to its MAC address. A RARP server that keeps all the mapping of MAC addresses to IP addresses replies back with the corresponding IP address for the diskless system

RARP The diskless system sends the RARP request to the broadcast address. ff:ff:ff:ff:ff:ff Only the RARP server replies back and it replies back directly to the diskless system.