Wednesday, January 5, 2011

Dynamic Host Configuration Protocol(DHCP)

Dynamic Host Configuration Protocol is the application layer protocol which automates network-parameter assignment to network devices from one or more DHCP servers. Even in small networks, DHCP is useful because it makes it easy to add new machines to the network.

When a DHCP-configured client (a computer or any other network-aware device) connects to a network, the DHCP client sends a broadcast query requesting necessary information from a DHCP server. The DHCP server manages a pool of IP addresses and information about client configuration parameters such as default gateway ,domain name the name servers, other servers such as time servers, and so forth. On receiving a valid request, the server assigns the computer an IP address, a lease (length of time the allocation is valid), and other IP configuration parameters, such as the subnet mask and the default gateway. The query is typically initiated immediately after booting , and must complete before the client can initiate IP-based communication with other hosts.

It used the UDP protocol ,UDP port 67 for sending data to the server, and UDP port 68 for data to the client.

DHCP operations fall into four basic phases: IP discovery, IP lease offer, IP request, and IP lease acknowledgement.

DHCP clients and servers on the same subnet communicate via UDP broadcasts. If the client and server are on different subnets, IP discovery and IP request messages are sent via UDP broadcasts, but IP lease offer and IP lease acknowledgement messages are unicast.To lease the time client send the DHCPRequest within the half of the lease time.


DHCP server may have three methods of allocating IP-addresses:

Dynamic: A network administrator assigns a range of IP addresses to DHCP, and each client computer on the LAN is configured to request an IP address from the DHCP server during network initialization. The request-and-grant process uses a lease concept with a controllable time period, allowing the DHCP server to reclaim (and then reallocate) IP addresses that are not renewed.

Automatic: The DHCP server permanently assigns a free IP address to a requesting client from the range defined by the administrator. This is like dynamic allocation, but the DHCP server keeps a table of past IP address assignments, so that it can preferentially assign to a client the same IP address that the client previously had.

Static: The DHCP server allocates an IP address based on a table with MAC address/IP address pairs, which are manually filled.

1) What are the DHCP mesasges?

Answer: DHCP message are given below, all message are broadcast message

DHCP Discover

DHCP Offer

DHCP Request

DHCP Ack

DHCP release to release the IP.

2) When DHCPnack is send by Server to client?

Answer:

DHCP server will issue a NAK to the client ONLY IF it is sure that the client, "on the local subnet", is asking for an address that doesn't exist on that subnet.

3) When DHCPDecline send to Client by Server?
Answer: When the
client has discovered through some other means that the suggested network address is already in use , uit send the DHCPdecline message to Server.

4) How the lease time renew for DHCP?
Answer: To renew the lease time the DHCP clent send the DHCP Request to the server , which is unicast.



Monday, January 3, 2011

RIP (Routing Information Protocol)

1) What is RIP?
Answer: RIP is the dynamic routing information protocol used in local as well as wide network.
RIP is a distance-vector routing protocol, which employs the hop count as a routing metric. The hold down time is 180 seconds. RIP prevents routing loops by implementing a limit on the number of hops allowed in a path from the source to a destination. The maximum number of hops allowed for RIP is 15. This hop limit, however, also limits the size of networks that RIP can support. A hop count of 16 is considered an infinite distance and used to deprecate inaccessible, inoperable, or otherwise undesirable routes in the selection process.

2) What are the types of RIP and there difference?
Answer: RIP has three version
RIPv1: It used broadcast address and has no support for router authentication.

RIPv2: It used multicast arress and support MD5 authentication .

RIPng:

RIPng (RIP next generation), is an extension of RIPv2 for support of IPv6, the next generation Internet Protocol. The main differences between RIPv2 and RIPng are:

  • Support of IPv6 networking.
  • While RIPv2 supports RIPv1 updates authentication, RIPng does not. IPv6 routers were, at the time, supposed to use IPsec for authentication.
  • RIPv2 allows attaching arbitrary tags to routes, RIPng does not;
  • RIPv2 encodes the next-hop into each route entries, RIPng requires specific encoding of the next hop for a set of route entries.
3) What is Route poisoning ?
Answer:

Route poisoning is a method to prevent routing loop within computer network. Distance vector routing protocol in computer networks use route poisoning to indicate to other routers that a route is no longer reachable and should be removed from their routing tables. A variation of route poisoning is split horizon with poison reverse whereby a router sends updates with unreachable hop counts back to the sender for every route received to help prevent routing loops.

When the protocol detects an invalid route, all of the routers in the network are informed that the bad route has an infinite (∞) route metric. This makes all nodes on the invalid route seem infinitely distant, resulting in preventing any of the routers from sending packet over the invalid route.

Some distance-vector routing protocols, such as RIP, use a maximum hop count to determine how many routers traffic must go through to reach the destination. Each route has a hop count number assigned to it which is incremented as the routing information is passed from router to router. A route is considered unreachable if the hop count exceeds the maximum allowed. Route poisoning is a method of quickly removing outdated routing information from other router's routing tables by changing its hop count to be unreachable (higher than the maximum number of hops allowed) and sending a routing update.

In the case of RIP, the maximum hop count is 15, so to perform route poisoning on a route its hop count is changed to 16, deeming it unreachable, and a routing update is sent.

In some routing protocols, each router advertises routes it has learned from a neighboring router back to the router the advertisement came from with an infinite route metric; this is called split horizon with poison reverse. This is done to reduce the possibility of loops and reduce route convergence time.

4) What are the mechanism to prevent the incorrect routing information in RIP?

Answer: RIP implements the split horizon, route poisoning and holddown mechanisms to prevent incorrect routing information from being propagated.

Holddown timer works by having each router start a timer when they first receive information about a network that is unreachable. Until the timer expires, the router will discard any subsequent route messages that indicate the route is in fact reachable. It can solve the case where multiple routers are connected indirectly. The classic example would be three routers configured in a triangle. In this situation,Split horizon and split horizon with poisoned reverse can do nothing.

In other words, a holddown keeps a router from receiving route until the network appears to be stable—until either an interface stops changing state (flapping) or a better route is learned.

Holddowns are usually implemented with timers. If the router detects a network unreachable, the timer is started. The router will then wait a present number of seconds until the network is stable. When the timer expires, the router will then receive its routing updates from other routers. For example in RIP the default holddown timer is set on 180 seconds.