TCP/IP Networking Protocol Basics
By scottmeaney
The software side of modern computer networking is dominated by Transmission Control Protocol/Internet Protocol which resides at layers 3-5 of the OSI Seven Layer Model. Internet Protocol (IP) version 4 (IPv4) and version 6 (IPv6) operates at the Network layer, while Transmission Control Protocol (TCP) as well as User Datagram Protocol (UDP) and Internet Control Message Protocol (ICMP) operate at the Transport and Session layers. Known as the TCP/IP Protocol Suite, these protocols define how connections between computer systems take place. TCP/IP can be used to connect a few computer systems together in a LAN or to connect multiple LANs into a Wide Area Network (WAN).
In a LAN, computer systems can use Ethernet protocol, Media Access Control (MAC) Addressing and Broadcasting to send data frames to other computer systems within the same LAN. However for communication with a computer system located in a different LAN, TCP/IP is necessary for one computer to obtain another computer's MAC address in order to send data to the computer system located in the WAN. TCP/IP uses logical addressing to overcome the limitations of Ethernet protocol. Every computer system on a TCP/IP network receives a unique IP address that identifies the computer, and IP addresses group together sets of computers into logical networks which distinguish one LAN from another. This allows computer systems on different LANs to communicate with each other without the need for MAC address broadcasting.
IPv4 addresses consist of 32 bit binary values which are converted into dotted decimal notation using the dotted octet numbering system and just like every MAC address is unique to each computer system on a network every IP address is unique as well. On Windows based systems the IPCONFIG command will display both the MAC address and IP address of the computer system, on Unix/Linux or Mac OS X the IFCONFIG command displays the same information. The main three functions of IP addresses are: to create a way to identify each and every LAN, to interconnect all of the LANs using routers and to allow those routers to use network identification to send data packets to the right network, and to give each computer a way to know if a data packet is intended for a computer system on the same LAN or for a computer system on a different LAN.
Computer systems on the same LAN share very similar IP addresses which allows LANs to be differentiated from one another. The network ID is the portion of the IP address that is shared by all computer systems on the same LAN, the part that is different between systems is known as the host ID. To connect a LAN to a WAN (other LANS), the LAN must be connected to a router which also has an IP address on the LAN that it connects. The router's IP address is known as the default gateway and routers use network IDs and routing tables to route network traffic to the correct computer systems. The Internet Assigned Numbers Authority (IANA) ensures that no two LANs share the same network ID.
IP uses a subnet mask to determine if a data packet is intended for a computer system on the LAN or for a computer system on the WAN. If a computer wants to send data to another system on its own LAN it simply sends out a broadcast for the other system's MAC address, however it wants to send data to another system on the WAN it must send the packet to the default gateway of the other system's LAN. A subnet mask is a string of ones followed by a number of zeroes totaling 32 bits which is typed into every TCP/IP host. The portion of the IP address that aligns with the ones of the subnet mask is the network ID portion of the IP address, while the portion that aligns with the zeroes is the host ID. When a computer system sends out data it compares the destination IP address with its own IP address using the subnet mask, if the destination IP address matches its own IP address wherever there is a one in the subnet mask, the sending computer knows it's a same LAN destination; the network IDs match. If any bit of the destination IP address is different where there are ones on the subnet mask, the sending system knows that the destination system is on a different LAN; the network IDs do not match. Address Resolution Protocol (ARP) is used by TCP/IP networks to determine the MAC address of the destination IP address once the destination LAN has been determined.
To make sure that no two computer systems share the same IP address the IANA established class licenses which divide the different types of IP addresses and has evolved into Classless Inter-Domain Routing (CIDR). CIDR is based on subnetting which uses subnet masks to take a single class of IP addresses and divide it into multiple smaller groups to enable more efficient use of IP addresses. Calculating subnet masks involves extending the subnet extension until the required number of subnets needed is reached using a formula of 2 to the power of number of network ID extension digits minus two (the subnet is always moved at least two digits).
Most networks nowadays use Dynamic IP Addressing or Dynamic Host Configuration Protocol (DHCP) as opposed to Static IP Addressing. A computer system configured to use DHCP automatically receives an IP address from the DHCP server whenever it connects to a network. The DHCP method of assigning IP addresses is more efficient than static IP addressing when considering computer systems that frequently connect, disconnect, and reconnect to networks. If a computer system is unable to communicate with the DHCP server it is assigned an IP address by Automatic Private IP Addressing (APIPA) which allows computers to communicate with one another on a network but does not provide access to the Internet. If a computer system has been assigned an APIPA IP address the user will need to try to obtain another IP address from the DHCP server; a new IP address can be obtained with the IP CONFIG /renew command.
Comments
No comments yet.