IST 228\Ch3\IP Addressing TCP/IP and DoD Model (TCP/IP Model) 1 IST 228\Ch3\IP Addressing Process/Application Layer • Defines protocols node-to-node application communication such as – DCHP, LPD, SNMP, DNS, NFS, Telnet, FTP, SMTP, TFTP • Controls user-interface specifications 2 IST 228\Ch3\IP Addressing Process/Application Layer Protocols • Telnet- terminal emulation • File Transfer Protocol (FTP) • Network File System: allows to different types of file systems operate. • Simple Mail Transfer Protocol (SMTP) • Line Printer Daemon (LDP): facilitates printer sharing • HTTP • Simple Network Management Protocol (SNMP) • X Windows 3 IST 228\Ch3\IP Addressing 4 Domain Name Service (DNS) • Resolves host names into IP addresses. – Discussion: Why do we need this? – Use nslookup, dig, and host to find the IP addresses for psu.edu and mit.edu • The DNS system is divided into nonoverlapping zones. • Each zones have one or more DNS servers. edu name server psu.edu bk.psu.edu yale.edu cs.yale.edu ist.bk.psu.edu is looking for the IP address for linda.cs.yale.edu IST 228\Ch3\IP Addressing Dynamic Host Configuration Protocol (DHCP) • Gives IP addresses to hosts, and more – IP address – Subnet mask – Domain name – Default gateway (routers) – DNS 5 IST 228\Ch3\IP Addressing The Host-to-Host Layer • Functions – Reliable end-to-end communication – Ensuring error free delivery of data – Prepares the data for delivery • Protocols – Transmission Control Protocol (TCP) – User Datagram Protocol (UDP) 6 IST 228\Ch3\IP Addressing Ports • TCP and UDP use port numbers to communicate with the upper layers. • Ports help to keep track of different conversations over the network simultaneously – The Well Known Ports are those from 0 through 1023. – The Registered Ports are those from 1024 through 49151 – The Dynamic and/or Private Ports are those from 49152 through 65535 Visit http://www.iana.org/assignments/port-numbers for well-known port numbers You can see LINUX ports /etc/services (type cat /etc/services |more) Use nmap to scan open ports of a machine. 7 IST 228\Ch3\IP Addressing 8 • Be familiar with these ports – – – – – – – – – – – TCP port 20 – FTP data transfer TCP port 21 – FTP control port TCP port 23 – Telnet TCP port 25 – SMTP TCP & UDP port 53 – DNS TCP (port 80) – HTTP Web services TCP & UDP port 123 – Network Time Protocol (NTP) TCP port 110 – Post Office Protocol version 3 (POP3) TCP port 119 – Network News Transport Protocol (NNTP) UDP port 69 – TFTP UDP port 161 – SNMP • How does it work? Telnet Z. A I got a packet. Destination port is 1030. Currently, my Telnet application is using this port, send it to the Telnet application. SP Destination port =23. I better send the packet to my Telnet application. B DP 1030 23 ........... SP DP 23 1030 ........... IST 228\Ch3\IP Addressing 9 TCP Function Definition Ordered data transfer and segmentation Continuous stream of bytes from upper-layer process that is segmented, numbered, and sequenced for transmission Establish and terminate a connection Process used to initialize port numbers and sequence and acknowledgement fields Flow control using windowing Process that uses window sizes to protect buffer space and routing devices Error recovery (reliability) Process of numbering and acknowledging data with sequence and acknowledgment header fields Multiplexing Multiplexing Function that allows receiving hosts to decide the correct application for which the data is destined, based on the port number Three-way hand shake IST 228\Ch3\IP Addressing TCP Segment Format • TCP creates a lot of overhead. • Discussion: Why do we need that much overhead? 10 IST 228\Ch3\IP Addressing User Datagram Protocol • Used transporting information that does not require reliable delivery • Does not sequence the segments • Sends the segments off and forgets about them • Does not create a virtual circuit • Connectionless protocol 11 IST 228\Ch3\IP Addressing The Internet Layer Protocols • Functions – Routing – Provide single network interface to upper layers • Protocols – Internet Protocol (IP) – Internet Control Message Protocol (ICMP) – Address Resolution Protocol (ARP) – Reverse Address Resolution Protocol (RARP) 12 IST 228\Ch3\IP Addressing Internet Protocol • IP sees the picture • Functions: – Receives segment from Host-to-Host Layer, fragment them into packets, using routing tables, routes them over the network, and then reassembles them into segments on the receiving end. 13 IST 228\Ch3\IP Addressing IP Header 14 IST 228\Ch3\IP Addressing Internet Control Message Protocol (ICMP) • Provides message control and errorreporting services between two TCP/IP host and between a host server and gateway to the Internet • Routes periodically sends following messages – Destination unreachable – Buffer full – Hops – Pings – Traceroute 15 IST 228\Ch3\IP Addressing 16 Address Resolution Protocol (ARP) • finds the hardware address of a host from a known IP address • How does it work? – First look at the ARP cache (ARP table). – If IP to MAC mapping is not in the cache, broadcast a ARP request to hosts on the local segment – If the device in the local network, it returns a ARP reply. – .. • Discussions: – How does the source know the IP of the destination? – What would happen if no ARP reply is received? – What happens when an ARP reply is received? – Why is it not a good idea to use static ARP cache in the local network? IST 228\Ch3\IP Addressing Reverse Address Resolution Protocol (RARP) • Discovers the identity of the IP address for diskless machines. 17 IST 228\Ch3\IP Addressing Routers on the network 18 IST 228\Ch3\IP Addressing Putting Things Together IP Routing 1. ICMP creates an echo pay load 2. ICMP hands the pay load to IP, which creates a packet. What is the information loaded in the IP header? 3. IP works with ARP to determine the destination is on the local network or not 4. No the destination is not on the local network, the packet needs to be sent to the default gateway. Look for the address of the local gateway. 19 IST 228\Ch3\IP Addressing 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. The default gateway address is 172.16.10.1 (the IP address of interface E0). MAC address must be known for this interface. Why? Check the ARP cache for the MAC address corresponding 172.16.10.1. MAC address is known now. Hand packet down to Data Link Layer. A frame is generated. The frame is handed down to the Physical Layer to be put on the medium. Every device on the collision domain receives the bits. They run CRC and check FCS field. The interface E0 matches the FCS field. Look what type of Network layer protocol is used. The packet is pulled out from the frame, and the frame is discarded. IP receives the packet and checks the destination IP address. The routing table must have an entity for 172.16.20.0, or the packet is discarded. The router finds an entity for 172.16.20.0 The router forwards the packet to the E1 buffer The E1 buffer must know the hardware address of the destination host. Why? 20 IST 228\Ch3\IP Addressing 16. The router sends an ARP request for 172.16.20.2. 17. Host B responds with its MAC address. 18. The Data Link Layer (in router) creates a frame. The frame is handed down to the Physical Layer to be sent out on the physical medium. 19. Host B receives the frame and runs a CRC. It is a match. 20. At the network layer, IP receives the packet. The protocol field is checked to find the owner of the payload. 21. It is for ICMP. The payload is handed to ICMP. 22. Happy Ending. 23. .. 24. .. 25. .. 26. .. 21