CCNA 1 version 3.1 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Contents 9.1 Introduction to TCP/IP 9.2 Internet Addresses 9.3 Obtaining an IP Address 2 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com In this module, we learn... TCP/IP introduction; The four-layer model; Comparing with OSI model; IPv4 and its addressing; Subnet concept; Private and public addresses; IPv6 introduction; Dynamic and static IP addresses; ARP. Overview IP TCP UDP Ethernet PPP HDLC ... HTTP SMTP SNMP ... Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com The U.S. Department of Defense (DoD) created the TCP/IP reference model. It wanted a network that could survive any conditions. TCP/IP also adopts layer model similar to OSI. There are four layers: Network Application, Transport, Internet, and Network Access. 1981: IPv4. It is mostly used today. 1992: IPv6 (or IPng). It is not popular yet, however it is supported by most of networking vendors. Students needs to master the comparision between TCP/IP and OSI. History in brief LAN and WAN technology. Best path determination and packet switching. Transport services from the end to end. High-level protocols, issues of representation, encoding, and dialog control. 3 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com IPv4 Addresses IPv4 addresses are 32 bits long, written in dotted decimal, and separated by periods. Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com IPv6 Addresses IPv6 addresses are 128 bits long, written in hexadecimal, and separated by colons. Colons separate 16-bit fields. Leading zeros can be omitted in each field. 4 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com The application layer of the TCP/IP model handles high-level protocols, issues of representation, encoding, and dialog control. The TCP/IP protocol suite combines all application related issues into one layer. Application Layer Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com File Transfer Protocol (FTP) is a reliable, connection-oriented service that uses TCP to transfer files. It supports bi-directional binary file and ASCII file transfers. Tri vial File Transfer Protocol (TFTP) is a connectionless service that uses the UDP. Example: TFTP is used on the router to transfer configuration files and IOS images. Network File System (NFS) is a distributed file system protocol suite developed by Sun Microsystems that allows file access to a remote storage device. Application Layer IP TCP UDP Ethernet PPP HDLC ... FTP ... TFTP NFS 5 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com IP TCP UDP Ethernet PPP HDLC ... SMTP Telnet ... ... Simple Mail Transfer Protocol (SMTP) administers the transmission of e- mail over networks. It does not provide support for transmission of data other than plaintext. Terminal emulation (Telnet) provides the capability to remotely access another computer. It enables a user to log in to an Internet host and execute commands. Application Layer Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com IP TCP UDP Ethernet PPP HDLC ... ... ... DNS SNMP Simple Network Management Protocol (SNMP) is a protocol that provides a way to monitor and control network devices, and to manage configurations, statistics collection, performance, and security. Domain Name System (DNS) is a system used on the Internet for translating names of domains and their publicly advertised network nodes into IP addresses. Application Layer 6 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Transport protocols segment and reassemble upper-layer applications into the same data stream between endpoints. The transport layer data stream provides end-to-end transport services. There are two protocols in this layer: TCP (Transmission Control Protocol), and UDP (User Datagram Protocol). Transport Layer Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com The transport layer constitutes: A logical connection between the endpoints; The sending host, and The receiving host. The Internet is often represented by a cloud. The transport layer sends data packets from the sending source to the receiving destination through the cloud. There are varieties of techniques: silding windows, sequencing numbers and acknowledgments, etc. Transport Layer sending host receiving host logical connection Internet cloud TCP and UDP provide end-to- end communications between host applications over the cloud of IP packets. 7 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com TCP and UDP: Segmenting upper-layer application data; Sending segments from end to end. TCP only: Establishing end-to-end operations (connection oriented); Flow control (end-to-end control) provided by sliding windows; Reliability provided by sequence numbers and acknowledgments. Transport Layer That cloud of IP packets deal with the issues such as Which of several paths is the best path for a given route? Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com The purpose of the Internet layer is to select the best path through the network for packets to travel. The main protocol that functions at this layer is the Internet Protocol (IP). Best path determination and packet switching occur at this layer. IP performs the following operations: Defines a packet and an addressing scheme; Transfers data between the Internet layer and network access layers; Routes packets to remote hosts. Internet Layer Protocols 8 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Internet Protocol (IP) provides connectionless, best-effort delivery routing of packets. IP is not concerned with the content of the packets but looks for a path to the destination. Internet Control Message Protocol (ICMP) provides control and messaging capabilities. Address Resolution Protocol (ARP) determines the data link layer address, MAC address, for known IP addresses. Reverse Address Resolution Protocol (RARP) determines IP addresses when the MAC address is known. Internet Layer Protocols IP TCP UDP Ethernet, PPP, HDLC, ... ARP/RARP ICMP I n t e r n e t
L a y e r Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com In a reliable protocol, the receiver confirms (ACK) the packet its received. Example: TCP. In a best effort or non-reliable protocol, the receiver keeps silent instead. Example: IP, UDP. Reliable vs. Best-effort Protocols Receiver: I confirm that Ive received the packet #n. Sender: Ive sent the packet #n. Protocol: I have the mechanism to know if the packet is received. Receiver: I keep silence upon receiving packets. Sender: Ive sent the packet #n. Protocol: I do not have the mechanism to know if the packet is received. This is a classification of networking protocols. Non-reliable does not mean inaccurately data delivery. 9 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Path Determination The purpose of the Internet layer is to select the best path through the network for packets to travel. sender receiver Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com The network access layer is also called the host-to-network layer. It includes the LAN and WAN technologies. Examples: Ethernet familly; SLIP and PPP; HDLC; ARP and RARP. In computers, we see them as system NIC drivers. Network Access Protocols ARP and RARP work at both Internet layer and Network Access layer. 10 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Comparing TCP/IP and OSI The Internet is developed by the standards of the TCP/IP protocols. The TCP/IP model gains credibility because of its protocols. In contrast, networks typically are not built on the OSI protocol. The OSI model is used as a guide for understanding the communication process. TCP/IP TCP/IP OSI OSI Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com The OSI model & the TCP/IP model Similarities of the OSI and TCP/IP models: Both have layers; Both have application layers, though they include very different services; Both have comparable transport and network layers; Packet-switched, not circuit-switched, technology is assumed; Networking professionals need to know both models. Differences of the OSI and TCP/IP models: TCP/IP combines the presentation and session layer; into its application layer; TCP/IP combines the OSI data link and physical layers into one layer; TCP/IP appears simpler because it has fewer layers; TCP/IP transport layer using UDP does not always guarantee reliable delivery of packets as the transport layer in the OSI model does. 11 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com The Internet Introduction Interconnection between two LANs with a router Interconnection between three LANs with two routers Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com The Internet Introduction The Internet provide connections among a good number of users (300 million). Yet it appears practically simple enough so that users view it as cloud where the reliable connection sevice is provided between any two hosts, regardless to the hosts platforms. However, with its bulky size (over 90 thousand routers), Internet is truelly complex, with a lot of standards, protocols, ... getting involved. 12 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com For any two systems to communicate, they must be able to identify and locate each other. We call it addressing. The hosts are grouped into networks. In the illustration, we use the A or B to identify the network and the number sequence to identify the individual host. The combination of letter (network address) and the number (host address) create a unique address for each device on the network. Addressing Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com An address generally represents the connection to the network. A device that have two connection points may need two addresses beloging to two networks. Each connection points (espcially in LAN technologies) also has its ID (example: MAC address) which is called physical address. There is also the need to map between physical adresses (layer 2) and logical addresses (layer 3). Addressing 13 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com IP address is 32-bit long. It is often writen in dotted decimal format. CCNA is supposed to master the BIN-DEC conversion. Remember: practice makes perfect. IP Address (IPv4) Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Every IP address has two parts. One part identifies the network where the system is connected, and a second part identifies that particular system on the network. Two different networks must have different network address (net-id), and two different hosts in the same network must have different host address (host- id). Of cause, hosts in the same network have the same network address. Addressing Rule 14 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com A router forwards packets from the originating network to the destination network using the IP protocol. The packets must include an identifier for both the source and destination networks. Using the IP address of destination network, a router can deliver a packet to the correct network. When the packet arrives at a router connected to the destination network, the router uses the IP address to locate the particular computer connected to that network. Routing Introduction ROUTER: I has routing table inside and I know how to forward packets so that they will reach the destination. ROUTER: I has routing table inside and I know how to forward packets so that they will reach the destination. Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Classes of IP Addresses As a hierachical addressing scheme, IP addresses are divided into classes. Class A addresses are assigned to larger networks. Class B addresses are used for medium-sized networks, and Class C for small networks. 15 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com When all host-bits are zeros, we have a number that represents network address. This address is reserved, namely it cannot be assigned to any host. Network Address 16 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com When host-bits are all one, we have a number that represents broadcast address. This address is also reserved, namely it cannot be assigned to any host. Example where Broadcast addresses are used: a host need to locate a specific service. Broadcast Address Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Unicast and Broadcast Transmission Unicast transmission Broadcast transmission The concept of unicast and broadcast transmission exist in both layer 2 and layer 3 protocols. There are refelections in the addressing scheme. 17 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Certain host addresses are reserved and cannot be assigned to devices on a network. These reserved host addresses include the following: Host-bits = all zeros (network address); Host-bits = all ones (broadcast address); Network-bits = all ones; Network-bits = all zeros; 127.x.x.x (loopback address = 127.0.0.1). Reserved IP Address Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com The stability of the Internet depends directly on the uniqueness of publicly used network addresses. In the figure, there is an IP conflict issue. A procedure was needed to make sure that addresses were in fact unique. Originally, an organization known as the Internet Network Information Center (InterNIC) handled this procedure. InterNIC no longer exists and has been succeeded by the Internet Assigned Numbers Authority (IANA). Required Unique Address 18 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Public IP addresses are unique. No two machines that connect to a public network can have the same IP address. Public IP addresses must be obtained from an Internet service provider (ISP) or a registry at some expense. With the rapid growth of the Internet, public IP addresses were beginning to run out (IP address depletion). New addressing schemes, such as classless interdomain routing (CIDR) and IPv6 were developed to help solve the problem. Private IP addresses are another solution. Public IP Addresses Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com RFC 1918 sets aside three blocks of IP addresses for private, internal use. These three blocks consist of one Class A, a range of Class B addresses, and a range of Class C addresses. Addresses that fall within these ranges are not routed on the Internet backbone. Internet routers immediately discard private addresses. Private IP Addresses 19 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com When addressing a nonpublic intranet, a test lab, or a home network, we normally use private addresses instead of globally unique addresses. Private addresses can be used to address point-to-point serial links without wasting real IP addresses. Connecting a network using private addresses to the Internet requires translation of the private addresses to public addresses. This translation process is referred to as Network Address Translation (NAT). Using Private Addresses Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Subnetting is another method of managing IP addresses. This method of di viding full network address classes into smaller pieces has prevented complete IP address exhaustion. The network is no longer limited to the default Class A, B, or C network masks and there is more flexibility in the network design. Analogy: telephone. Subnet addresses include the network portion, plus a subnet field and a host field. To create a subnet address, a network administrator borrows bits from the host field and designates them as the subnet field. Introduction to Subnetting 20 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com When TCP/IP was adopted in the 1980s (IPv4), it relied on a two-level addressing scheme. The Class A and B addresses make up 75% of the address space, however fewer than 17,000 organizations can be assigned a Class A or B network number. Class C network addresses are far more numerous than Class A and Class B addresses, although they account for only 12.5% percent of the possible four billion IP addresses. Unfortunately, Class C addresses are limited to 254 usable hosts. IP Address Depletion Class A & B: virtually exhausted Class C: nearly exhausted, too Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com IPv4 and IPv6 Addresses IPv4 32-bit IPv6 128-bit 21 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com After years of planning and development, IPv6 is slowly being implemented in select networks. Eventually, IPv6 may replace IPv4 as the dominant Internet protocol. IPv4 and IPv6 4.3 e 9 IP addresses 3.4 e 38 IP addresses Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Obtaining IP Addresses Devices come with MAC addresses (layer-2). However, IP addresses (layer-3) require proper configuration. There are basically two ways to obtain IP addresses: static and dynamic. 22 Static assignment works best on small, infrequently changing networks. The system administrator manuall y assigns and tracks IP addresses for each computer, printer, or server on the intranet. Good recordkeeping is critical to prevent problems which occur with duplicate IP addresses. Static assignment works best on small, infrequently changing networks. The system administrator manuall y assigns and tracks IP addresses for each computer, printer, or server on the intranet. Good recordkeeping is critical to prevent problems which occur with duplicate IP addresses. Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com RARP Reverse Address Resolution Protocol (RARP) associates a known MAC addresses with an IP addresses. This association allows network devices to encapsulate data before sending the data out on the network. A network device, such as a diskless workstation, might know its MAC address but not its IP address. RARP allows the device to make a request to learn its IP address. 23 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com RARP Operation: 1: ARP request 2: ARP response 3: RARP request 4: RARP response 5: Dynamic RARP request 6: Dynamic RARP response 7: Dynamic RARP error 8: InARP request 9: InARP response ARP and RARP share the same packet format, which is encapsulated on layer-2 frames. They differentiate themselves by the operation field. Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com RARP Hardware Type specifies a hardware interface type for which the sender requires a response (ie. ~layer 2). Protocol Type specifies the type of high level protocol address the sender has supplied (ie. ~layer 3). 24 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com RARP HLen: Hardware address length. PLen: Protocol address length. Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com RARP Sender Hardware Address: Hardware address of the sender. Sender Protocol Address: Protocol address of the sender. Target Hardware Address: Hardware address of the targer. Target Protocol Address: Protocol address of the target. 25 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com RARP The workstation boots, and then generates an RARP request. It broadcasts the request to all hosts (using layer-2 broadcast address). All other host discard the request, except the RARP server, who accepts it. I needs an IP address! Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com RARP The RARP server generates the RARP response which contain its answer. It broadcasts the response to all the hosts. The workstation receives the answer and set its IP address. Thanks. From now on, I am 192.168.10.36 Here it is: 192.168.10.36! 26 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com BOOTP The bootstrap protocol (BOOTP) operates in a client-server environment and only requires a single packet exchange to obtain IP information. However, unlike RARP, BOOTP packets can include the IP address, as well as the address of a router, the address of a server, and vendor- specific information, etc. BOOTP is encapsulated on UDP datagram. Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com BOOTP Op: Message operation code; can be BOOTREQUEST or BOOTREPLY. Htype: Hardware address type. HLen: Hardware address length. Hops: Clients place zero, this field is used by BOOTP server to send request to another network. 27 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com BOOTP Xid: Transaction ID Seconds: Seconds elapsed since the client began the address acquisition or renewal process. Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com BOOTP Ciadder: Client IP address. Yiadder: Your (client) IP address. Siadder: IP address of the next server to use in bootstrap. Giadder: Relay agent IP address used in booting via a relay agent. Chadder: Client hardware address. 28 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com BOOTP Server Host Name: Specifies particular server to get BOOTP information from. Boot File Name:Alow multiple boot files (example: for different OSes). Vendor Specific Area: Optional vendor information that can be passed to the host. Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com BOOTP The workstation boots, and then generates an BOOTP request. It broadcasts the request to all hosts (IP source address = unknown). All other host discard the request, except the BOOTP server, who accepts it. I needs an IP address! 29 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com BOOTP The BOOTP server generates the BOOTP reply which contain its answer. It broadcasts the response to all the hosts. The workstation receives the answer and set its IP address. Thanks. From now on, I am 192.168.10.36 Here it is: 192.168.10.36! I keep a profile for each clients: IP=..., MAC=... IP=..., MAC=... IP=..., MAC=... Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com DHCP Dynamic host configuration protocol (DHCP) is the successor to BOOTP. Unlike BOOTP, DHCP allows a host to obtain an IP address dynamically without indi vidual profile that the network administrator having to set up for each device. All that is required when using DHCP is a defined range of IP addresses on a DHCP server. The major advantage that DHCP has over BOOTP is that it allows users to be mobile. DHCP offers a one to many ratio of IP addresses and that an address is available to anyone who connects to the network. client server request re s p o n s e client server request re p ly client server request o ffe r request a c k RARP BOOTP DHCP 30 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com DHCP DHCP uses the same message structure of BOOTP, with some extentions (subnet masks, etc.) The idea is that the entire network configuration of a computer can be obtained in one message. Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com DHCP The laptop boots, and then generates an DHCP request. It broadcasts the request to all hosts (to discover who is the server). All other host discard the request, except the DHCP servers, who accept it. I needs an IP address! Both of us are supposed to receive DHCP messages. 31 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com DHCP The DHCP servers generates the DHCP offers which contain its answer. It broadcasts the response to all the hosts. The laptop receives the answers, select one of them (the first one). OK, I accept one offer of yours. My offer is: 192.168.10.35! My offer is: blah blah! Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com DHCP The laptop sends DCHPREQUEST addressed to the specific DHCP server that has sent the accepted offer. Heres my DHCPREQUEST, specifically for you. Good, got it! 32 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com DHCP The DHCP server sends the DHCPACK And the laptop sets the IP address accordingly. Thanks! From now on I am 192.168.10.35! Here is the ACK Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com ARP The issue of address mapping between level-2 and level-3 addresses are quite relevent. In TCP/IP communication, a host needs to know both IP address and MAC address of the destination host in order to send packet to it. So there comes Address Resolution Protocol (ARP) which helps hosts in the same LAN segments to find each other MAC addresses. 33 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Proxy ARP Communications among LAN segments have an additional task. TCP/IP has a variation on ARP called Proxy ARP that will provide the MAC address of an intermediate device (example router) for transmission outside the LAN to another network segment. Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Some devices keep the IP-MAC mapping in a so-called ARP table which is stored in RAM. Example: arp -a, arp -d *. When a devices needs to send data to a host --whose IP is known but MAC is unknown-- it send an ARP request as a broadcast frame. Then the destination reply with ARP reply. Another way to build ARP table is to monitor the traffic. Router generally do not forward such the broadcast. If this feature is turned on, a router performs a Proxy ARP. However, in reality, we apply the default gateway feature. When the destination host is of the different network, then the IP packet is sent to the default gateway (MAC) while IP address is set to the final destination. If there is neither default gateway nor Proxy ARP, no traffic can leave the local network. ARP Please remember that both ARP and RARP use the same message structure. 34 Hc vin mng Cisco Bch Khoa - Website: www.ciscobachkhoa.com Summary Why the Internet was developed and how TCP/IP fits the design of the Internet The 4-layers of the TCP/IP model; the functions of each layer of the TCP/IP model The comparision between the OSI model and the TCP/IP model IP addressing gives each device on the Internet a unique identifier IP address classes are logical divisions of the address space used to meet the needs of various sizes of networks Subnetting is used to divide a network into smaller networks Reserved addresses fulfill a special role in IPaddressing and cannot be used for any other purpose Private addresses cannot be routed on the public Internet. The function of a subnet mask is to map the parts of an IP address that are the network and the host Someday IPV4 will be completely obsolete and IPV6 will be the commonly used version A computer must have an IP address to communicate on the Internet An IP address may be configured statically or dynamically, Dynamically IP addressing can be achived by using RARP,BOOTP or DHCP DHCP supplies more information to a client than BOOTP, DHCP allows computers to be mobile ARP and Proxy ARP can be used to solve address resolution problems