OSI Model :FTP & DHCP - VIII

OSI Model :FTP & DHCP - VIII 

⚡ File Transfer Protocol (FTP) ðŸ“œ

Another popular Application layer protocol is the File Transfer Protocol (FTP). FTP was created to facilitate file transfers between clients and servers. An FTP client is a computer application that is used to push and grab files from a server that is running the FTP daemon (FTPd).

FTP requires two connections between the client and the server to transfer files successfully: one for commands and answers and the other for real file transfer. The client connects to the server on TCP port 21 for the first time. This connection handles control traffic, which includes client instructions and server responses. 

The client connects to the server for the second time using TCP port 20. This connection is used for real file transfers and is generated each time a file is transmitted. The file transfer can happen in either direction. The client can download (pull) a file from the server or, the client can upload (push) a file to the server.

⚡ Dynamic Host Confirmation Protocol (DHCP)  ðŸ“œ

The Dynamic Host Confirmation Protocol (DHCP) service allows network devices to get IP addresses and other data from a DHCP server. This service manages IP addresses, subnet masks, gateways, and other IP networking characteristics.

When a host joins to the network, DHCP allows it to receive an IP address on the fly. A request for an address is made to the DHCP server. The DHCP server selects an address from a pool of addresses and assigns ("leases") it to the host for a predetermined length of time.

DHCP
Fig 1.1- DHCP

On larger networks local networks, or where the user population changes frequently, DHCP is preferred. New users may arrive with laptops and need a connection. Others have new workstations that need to be connected. Rather than have the network administrator assign IP addresses for each workstation, it is more efficient to have IP addresses assigned automatically using DHCP.

DHCP distributed addresses are only leased for a limited time and are not permanently given to hosts. If the host is shut off or disconnected from the network, the address is returned to the pool for reuse. This is particularly useful for mobile users who come and go on a network. Users can travel freely between locations and re-establish network connections. Once the hardware connection is established, either over a cable or wireless LAN, the host may get an IP address.

DHCP allows you to connect to the Internet via wireless hotspots at airports or coffee shops. As you enter the area, your laptop's DHCP client establishes a wireless connection with the local DHCP server. Your laptop is assigned an IP address by the DHCP server.

The DHCP server is normally situated at the ISP with home networks, and a host on the home network obtains its IP configuration straight from the ISP. 

Because any device connected to the network can get an address, DHCP can constitute a security concern. Because of this danger, physical security should be considered while deciding whether to employ dynamic or manual addressing.

Both dynamic and static addressing have their uses in network architecture. DHCP and static addressing are both used in many networks. Fixed addresses are used for network devices such as gateways, switches, servers, and printers, whereas DHCP is used for general purpose hosts such as end user devices.

In the absence of DHCP, users must manually enter the IP address, subnet mask, and other network parameters in order to connect to the network. When a DHCP-enabled client turns on, the DHCP server maintains a pool of IP addresses and leases one to it. Because the IP addresses are dynamic (leased) rather than static (permanently issued), addresses that are no longer in use are automatically returned to the pool for reallocation. 

When a DHCP-configured device powers up or connects to the network, the client broadcasts a DHCP DISCOVER packet to discover any accessible DHCP servers on the network. A DHCP server responds with a DHCP OFFER, which is a lease offer message including an assigned IP address, subnet mask, DNS server, and default gateway information, as well as the lease duration.

If there is more than one DHCP server on the local network, the client may receive numerous DHCP OFFER packets and must select amongst them before broadcasting a DHCP REQUEST packet that indicates the specific server and lease offer that the client is accepting. A client may opt to request an address that the server has previously assigned to it. 

Assuming that the IP address requested by the client, or offered by the server, is still valid, the server would return a DHCP ACK message that acknowledges to the client the lease is finalized. If the offer is no longer valid - perhaps due to a time-out or another client allocating the lease - then the selected server will respond with a DHCP NAK message (Negative Acknowledgement). If a DHCP NAK message is returned, then the selection process must begin again with a new DHCP DISCOVER message being transmitted.

Once the client has the lease, it must be renewed prior to the lease expiration through another DHCP REQUEST message.

The DHCP server ensures that all IP addresses are unique (an IP address cannot be assigned to two different network devices simultaneously). Using DHCP enables network administrators to easily reconfigure client IP addresses without having to manually make changes to the clients. Most Internet providers use DHCP to allocate addresses to their customers who do not require a static address.