Curs PC si internet cap 11.2 Network-to-Network Communications

label Cursuri autorenew 29 Sep 2025, 16:55
11.2 Network-to-Network Communications 11.2.1 Methods for assigning an IP address Instructor Note By now the students have probably been convinced of the importance of IP addresses. But an important question about them has been left unaddressed -- how does a host obtain its IP address? Four different methods for obtaining an IP addressed are described. After you have determined the addressing scheme for a network, you must choose the method for assigning addresses to hosts. There are essentially two methods for assigning IP addresses - static addressing and dynamic addressing. Regardless of which addressing scheme you use, no two interfaces can have the same IP address.Static AddressingIf you assign IP addresses statically, you must go to each individual device and configure it with an IP address. This method requires you to keep very meticulous records, because problems can occur on the network if you use duplicate IP addresses. Some operating systems, such as Windows 95 and Windows NT, send an ARP request to check for a duplicate IP address when they attempt to initialize TCP/IP. If they discover a duplicate, the operating systems will not initialize TCP/IP and will generate an error message. Record keeping is important too, because not all operating systems identify duplicate IP addresses.Dynamic AddressingThere are a few different methods that you can use to assign IP addresses dynamically. Examples of these are:Reverse Address Resolution Protocol (RARP)Reverse address resolution protocol (RARP) binds MAC addresses to IP addresses. This binding allows some network devices to encapsulate data before sending them out on the network. A network device such as a diskless workstation might know its MAC address, but not its IP address. Devices using RARP require that a RARP server be present on the network to answer RARP requests. Lets look at an example where a source device wants to send data to another device, and the source knows its own MAC address, but is unable to locate its own IP address in its ARP table. In order for the destination device to retrieve the data, pass it to higher layers of the OSI model, and respond to the originating device, the source must include both its MAC address and IP address. Therefore, the source initiates a process called a RARP request, which helps it detect its own IP address. The device builds a RARP request packet and sends it out on the network. To ensure that all devices see the RARP request on the network, it uses a broadcast IP address. A RARP request consists of a MAC header, an IP header, and an ARP request message. The RARP packet format contains places for MAC addresses of both destination and source. The source IP address field is empty. The broadcast goes to all devices on the network; therefore the destination IP address will be set to all binary 1s. Workstations running RARP have codes in ROM that direct them to start the RARP process, and locate the RARP server. BOOTstrap Protocol (BOOTP)A device uses BOOTstrap protocol (BOOTP) when it starts up, to obtain an IP address. BOOTP uses UDP to carry messages; the UDP message is encapsulated in an IP datagram. A computer uses BOOTP to send a broadcast IP datagram (using a destination IP address of all 1s - 255.255.255.255). A BOOTP server receives the broadcast and then sends a broadcast. The client receives a datagram and checks the MAC address. If it finds its own MAC address in the destination address field, then it takes the IP address in that datagram. Like RARP, BOOTP operates in a client-server environment, and only requires a single packet exchange. However, unlike RARP, which only sends back a 4 octet IP address, BOOTP datagrams can include the IP address, the address of a router (default gateway), the address of a server, and a vendor-specific field. One of the problems with BOOTP is that it was not designed to provide dynamic address assignment. With BOOTP you create a configuration file that specifies the parameters for each device. Dynamic Host Configuration Protocol (DHCP)Dynamic host configuration protocol (DHCP) has been proposed as a successor to BOOTP. Unlike BOOTP, DHCP allows a host to obtain an IP address quickly and dynamically. All that is required using DHCP is a defined range of IP addresses on a DHCP server. As hosts come online they contact the DHCP server and request an address. The DHCP server chooses an address and allocates it to that host. With DHCP, the entire computers configuration can be obtained in one message (e.g. along with the IP address, the server can also send a subnet mask). 11.2 Network-to-Network Communications 11.2.2 DHCP initialization sequence Instructor Note This target indicator explain the DHCP process in greater detail. Since DHCP is so commonly used, it is important for students to be familiar with this network process. When a DHCP client boots, it enters an initialize state. It sends DHCPDISCOVER broadcast messages, which are UDP packets with the port number set to the BOOTP port. After sending the DHCPDISCOVER packets, the client moves into the select state and collects DHCPOFFER responses from DHCP server. The client then selects the first response it receive and negotiates lease time (the length of time it can keep the address without renewing it) with the DHCP server by sending a DHCPREQUEST packet. The DHCP server acknowledges a client request with a DHCPACK packet. The client can now enter the bound state and begin using the address. 11.2 Network-to-Network Communications 11.2.3 IP key components Instructor Note This target indicator provides an overview of the key components of the Internet Protocol -- the IP datagram, the Address Resolution Protocol, and the Internet Control Message Protocol. Students may be bewildered by all of the acronyms introduced in first semester; help them differentiate them. IP, ARP, and ICMP are all related Layer 3 protocols which a fundamental to understanding how the entire Internet works. In order for devices to communicate, the sending devices need both, the IP addresses and the MAC addresses, of the destination devices. When they try to communicate with devices whose IP addresses they know, they must determine the MAC addresses. The TCP/IP suite has a protocol, called ARP, that can automatically obtain the MAC address. ARP enables a computer to find the MAC address of the computer that is associated with an IP address. Note: The basic unit of data transfer in IP is the IP packet. Packet processing occurs in software, which means that content and format are not hardware dependent. A packet is divided into two major components: the header, which includes source and destination addresses; and the data. Other types of protocols have their own formats. The IP packet is unique to IP.Note: Another major component of IP is Internet Control Message Protocol (ICMP). This protocol is used by a device to report a problem to the sender of a message. For example, if a router receives a packet that it cannot deliver, it sends a message back to the sender of the packet. One of the many features of ICMP is echo-request/echo-reply, which is a component that tests whether a packet can reach a destination by pinging the destination. 11.2 Network-to-Network Communications 11.2.4 Function of the address resolution protocol (ARP) Instructor Note This target indicator explains the details of ARP. ARP, as a basic network process, should be well-understood by the students. Layer 3 protocols determine whether data passes beyond the network layer to higher levels of the OSI model. A data packet must contain both, a destination MAC address and a destination IP address. If it lacks one or the other, the data will not pass from Layer 3 to the upper layers. In this way, MAC addresses and IP addresses act as checks and balances for each other. After devices determine the IP addresses of the destination devices, they can add the destination MAC addresses to the data packets. There are a variety of ways that devices can determine the MAC addresses they need to add to the encapsulated data. Some keep tables that contain all the MAC addresses and IP addresses of other devices that are connected to the same LAN. They are called Address Resolution Protocol (ARP) tables, and they map IP addresses to the corresponding MAC addresses. ARP tables are sections of RAM memory, in which the cached memory is maintained automatically on each of the devices. It is a rare occasion when you must make an ARP table entry manually. Each computer on a network maintains its own ARP table. Whenever a network device wants to send data across a network, it uses information provided by its ARP table. When a source determines the IP address for a destination, the source consults its ARP table in order to locate the MAC address for the destination. If the source locates an entry in its table (destination source address to destination MAC address), it binds, or associates, the IP address to the MAC address and uses it to encapsulate the data. The data packet is then sent out over the networking media to be picked up by the destination. 11.2 Network-to-Network Communications 11.2.5 ARP operation within a subnet Instructor Note This target indicator further explains the ARP process. One way to present this material is again by kinesthetically acting out the process. Have several students portraying several hosts. One of the hosts knows the IP address, but not the MAC address, of a destination computer. So it sends out a broadcast ARP request. The destination computer sends an ARP reply with its MAC address in the destination MAC field. Then IP communication between the two hosts can proceed. If a host wants to send data to another host, it must know the destination IP address. If it is unable to locate a MAC address for the destination in its own ARP table, the host initiates a process called an ARP request, that enables it to discover the destination MAC address. A host builds an ARP request packet and sends it to all devices on the network. To ensure that all devices see the ARP request, the source uses a broadcast MAC address. The broadcast address in a MAC addressing scheme has all places set to hexadecimal F. Thus, a MAC broadcast address would have the form FF-FF-FF-FF-FF-FF. Because ARP request packets travel in a broadcast mode, all devices on the local network receive the packets and pass them up to the network layer for further examination. If the IP address of a device matches the destination IP address in the ARP request, that device responds by sending the source its MAC address. This is known as the ARP reply. Example:Source device 197.15.22.33 is asking for the MAC address of the destination with IP address 197.15.22.126, Destination device 197.15.22.126 picks up the ARP request and responds with an ARP reply containing its MAC address. Once the originating device receives the ARP reply, it extracts the MAC address from the MAC header, and updates its ARP table. The originating device can then properly address its data with both, a destination MAC address, and a destination IP address. It uses this new information to perform Layer 2 and Layer 3 encapsulations of the data, before it sends them out over the network.When the data arrives at the destination, the data link layer makes a match, strips off the MAC header, and transfers the data up to the network layer. The network layer examines the data and finds that the IP address matches the destination IP address carried in the IP header. The network layer strips off the IP header, and transfers the encapsulated data to the next highest layer in the OSI model, the transport layer (Layer 4). This process is repeated until the rest of the packet's partially decapsulated data reaches the application, where the user data may be read.