• No se han encontrado resultados

Calles, Parques, Jardines y su equipamiento

FUNCIONES Y SERVICIOS PÚBLICOS QUE BRINDA EL MUNICPIO 1 Génesis de dicha Actividad

5. Funciones y Servicios Consagrados dentro del Artículo 115 Constitucional

5.8 Calles, Parques, Jardines y su equipamiento

As noted earlier, the entire DHCP conversation takes place using broadcast messages. When a DHCP client requests an IP address, it sends a broadcast DHCPDISCOVER message to the local subnet. DHCP servers, in turn, respond to the request by broadcasting DHCPOFFER messages. The client receives these messages and accepts one of them. The client then responds with a broadcast DHCPREQUEST message, in which the DHCP server that was

selected is identified. The DHCP server, upon receiving the DHCPREQUEST message, allocates the IP address in its database and responds with a DHCPACK message to the client. So what happens if the network environment is not a single subnet, but a routed environment containing multiple subnets? In a routed environment, separate segments are connected via routers. A router is a hardware component that contains two or more interfaces that connect the router to the multiple physical segments. The router directs traffic between the subnets by examining the destination IP addresses in the packet headers. If a packet is destined for another subnet, the router examines its routing table to determine if a route to that subnet is available. If one is available, the router sends the packet out the interface that is the next hop to the subnet. If a route is not available, the router drops the packet and sends an ICMP message to the sending computer stating that the destination is not available.

Besides routing packets, another role a router plays is containing broadcast traffic to a single subnet. Broadcast traffic can take many forms, such as ARP requests, DHCP requests, NetBIOS name resolution requests (B-Node), etc. If broadcast traffic like this was permitted to travel throughout the network, the network would come to a grinding halt. By containing these broadcasts, routers create what is known as a broadcast domain (see Figure 3.8).

Figure 3.8. A routed environment

Because broadcasts cannot travel beyond the local subnet, DHCP conversations are impossible in a routed environment unless the DHCP server and DHCP client are on the same subnet. Having seen this problem, the IETF identified a solution.

Defined in RFC1542, the DHCP relay agent is a software program that runs on a computer or router. Its sole purpose is to forward DHCP or BOOTP requests to the DHCP server on behalf of the client. It accomplishes this by turning the broadcast requests into unicast messages sent directly to the server. The server then replies to the relay agent using a unicast message, and the relay agent forwards the message to the client.

3.4.1 How the DHCP Relay Agent Operates

DHCP broadcast messages sent from a DHCP client to a DHCP server have their UDP destination port set to 67. On a host running the relay agent software, the relay agent listens to port 67 for any DHCP messages.

As mentioned in Chapter 2 and earlier in this chapter, BOOTP and DHCP packets use a field called op to identify whether the message is a BOOTPREQUEST or a BOOTPREPLY. This

is true for the entire DHCP conversation, i.e., all requests from the DHCP client are BOOTPREQUEST messages and all replies from the DHCP server are BOOTPREPLY messages. The relay agent responds differently depending on the message type.

3.4.1.1 The BOOTPREQUEST message

When a DHCP relay agent receives a BOOTPREQUEST message, it checks a number of the fields in the packet to determine how to handle the message.

First, the relay agent checks the value of the hops field. The hops field determines the number

of routers, or "hops," between the client and the server. According to RFC1542, the relay agent must discard BOOTPREQUEST messages with a hops value exceeding 16. This is to

keep BOOTPREQUEST messages from continuously traveling throughout the network. The default threshold setting for this field should be set to 4 hops. If the hops field is less than the

configured threshold, the relay agent should increment the hops field by one and process the

packet for forwarding.

Next, the relay agent must examine the giaddr field in the BOOTPREQUEST message. The

giaddr field contains the IP address of the gateway or router that first received this

BOOTPREQUEST message. If the giaddr field is zero, the relay agent must enter the IP

address of the interface that received the request. If the giaddr field is not zero, the relay

agent must not modify or change the IP address in the field.

Once the giaddr and hops fields have been examined and modified if necessary, the relay

agent forwards the BOOTPREQUEST as a unicast message to the DHCP server. The DHCP relay agent is configured with the DHCP server's IP address.

3.4.1.2 The BOOTPREPLY message

When the DHCP server receives the BOOTPREQUEST message from the DHCP relay agent, the server processes the request just like any other request.

The DHCP server examines the giaddr field in the BOOTPREQUEST to determine which

scope the server should use to offer an IP address from. After it selects a scope, it reserves an IP address in that scope.

In a routed environment, the DHCP server examines the ciaddr field in the

BOOTPREQUEST. The ciaddr field contains the client's current IP address. If the ciaddr

field is non-zero, the DHCP server sends the BOOTPREPLY as a unicast message to the client's IP address. If the ciaddr field is zero, the DHCP server examines the giaddr field in

the BOOTPREQUEST to determine the IP address of the gateway by which the message was originally received. The server then creates a BOOTPREPLY (a DHCPOFFER) message and sends it to the gateway IP address.

giaddr

The giaddr field is used to determine the interface that the BOOTPREPLY message

must be sent with. If the giaddr does not match any of the relay agent's interfaces, the

relay agent discards the message.

yiaddr

The yiaddr field is the IP address assigned to the DHCP client by the DHCP server.

chaddr

The chaddr field identifies the hardware or MAC address of the DHCP client.

htype

The htype field identifies the hardware type of the DHCP client, i.e., Ethernet.

hlen

The hlen field specifies the length of the hardware address.

flag

The flag field is used to determine whether the BOOTPREPLY message should be

sent as a broadcast or unicast message. If the flag field is set to 1, the message should

be broadcast. If it is set to 0, the message should be unicast to the IP address specified in yiaddr and the hardware address specified in chaddr.

Once the relay agent examines these fields, the relay agent forwards the message out of the interface specified in the giaddr field.

3.5 Summary

In this chapter, I described the differences between BOOTP and DHCP. Although they share many traits, there are significant differences in their operation. The BOOTP conversation is very simple, comprising a request and a reply. Because BOOTP uses static configuration files, and a client's MAC address must be listed in the file to receive an IP address, only one BOOTP server can be operational on a network at a time. The DHCP conversation in which a DHCP client broadcasts a request that multiple DHCP servers can receive is more robust. All DHCP servers that receive the request can respond. The DHCP client can then select a lease offer.

Also covered were the reasons why DHCP was developed and is currently being used in today's TCP/IP-based networking environments. Next I went step by step through the DHCP conversation, detailing the data that is supplied by each type of message. Finally I covered how the DHCP relay agent operates. When the DHCP client requests an IP address, it broadcasts the request. In a routed environment, routers do not route broadcasts. The DHCP relay agent provides a method for DHCP to function in a routed environment by intercepting