Everybody now-a-days uses the TCP/IP protocol. It is actually a TCP/IP protocol Suite, or multiple protocols tied together. TCP/IP v4 is not the same as TCP/IP v6. They are very different in terms of configurations.
Table of Contents
What Are TCP/IP Protocols?
The main protocols are:
TCP or Transmission Control Protocol (TCP is on OSI Layer 4; Transport Layer) is responsible for the quality of communication. Biggest con or negative trait for TCP is Windowing for real-time communication.
IP or Internet Protocol. IP controls the routing of information to different devices, servers, etc. IP deals with IP address, Subnet Mask, Default Gateway, DNS, … IP protocol is what allows two computers to figure out where the other one is, so they can start communicating right away. IP Address are addresses for every computer & device on the Network.
IP connects two or more computers; TCP controls the communication between two or more computers.
Route-able vs. Non-Route-able Protocols (TCP/IP)
TCP/IP is called a route-able protocol. Route-able means that you can divide the networks into multiple subnets. And you can connect multiple subnets using routers.
But in non-route-able protocols, if a computer wants to talk to another computer on the subnet, it has to go through or talk all the other computers also on the same subnet. This can cause absolute havoc for bandwidth utilization, when all these different computers try to talk to each other. Because imagine if every single computer on an entire internet was connected to every other computer on the entire internet. That’s why non-route-able protocols are generally not used. That’s why those who designed the TCP/IP protocols made the TCP/IP route-able.
Route-able protocols allow dividing huge networks into multiple smaller subnets that prevent the bandwidth utilization problem from so many computers trying to talk to each other at once.
Properties of TCP/IP Protocols
IP (on the 3rd OSI Layer, Network Layer) is about routing the information, or how the computers “discover” each other, so that they can communicate. Once the computers have found each other using IP, they “communicate” using TCP. How the 2 computers talk to each other is dictated by TCP. ie. What language, how fast they the two computers are going to talk…
How Windowing works in TCP
TCP uses Windowing. Windowing is the process by which the client’s computer sends information to the server computer. So when 2 computers try to talk, Windowing is the process in which data is sent from one computer to the other. When the internet was made, it was for the military, it was made for World War III scenarios ie. What happens if nuclear war happens? Then you have military bunkers trying to communicate with each other. under this pretense, TCP/IP internet protocol was designed.
So the government & military realized the internet/lines of communication would be very flaky. Therefore you wouldn’t be able to send large amounts of data without parts of it being lost or corrupted. So they came up with a concept called windowing.
Typically, computer 1 is trying to send information to computer 2.
So in TCP/IP, all the data is broken into packets. So if you try to send a movie or a word document, then the data is divided into many individual packets.
Because those computers don’t know what the quality of the transmission lines are, the 1st computer doesn’t want to send the entire document all at once because it may become garbled/corrupted. So by Windowing, Which is the computer starts sending packets in groups, and those groups become progressively bigger by doubling (doubling = sending twice the number of packets) until there is an error. Like a lost packet from the other side. Then the process repeats, back to sending a single packet.
Packets are small, like bits/bytes
You can see that the number of packets sent are Doubling; which continues until there is a lost packet.
Although the internet has progressed passed the 56k modem in this day and age, Windowing is still relevant due to real-time communications. TCP/IPv4 can be a real mess for real time communication. So if there are any problems on the internet or network, Windowing will regularly send small packets through the flaky internet connection. That is not enough to keep up real-time communication. I myself observe this while my parents in the US were trying to video call my uncle in Bangladesh. Their video feed would constantly be stuttering & buffering, since the line from the US to Bangladesh is not stable due to distance and 3rd world quality network lines.
Subnet Mask vs Default Gateway
Subnet Mask is a way to separate a network logically so that different computers & devices can’t talk to other ones on the same physical network ie. you have 200 computers on a network; and so you don’t want all of them talking to each other even though they are connected to the same physical network. So you prevent them from talking to each other by using Subnet Mask.
Default Gateway is the router for the subnetwork that you are on. So when the computer cannot find the local network on the Subnet Mask, the computer then goes to the Default Gateway to find the network. Examples of Default Gateways include routers, DSL modems, Cable Modems, etc.
Default Gateways are what connects your subnet to all the other possible subnets that are out there on the internet.
DNS server = Domain Name Server
DNS servers map & matches Domain Names to IP addresses…
DHCP is Dynamic Host Control Protocol
Every device on a network needs an IP address. Without IP address, device cannot receive or send information. Every computer on the network needs to know it’s IP address, Subnet Mask, Default Gateway, and which DNS server to talk to. So there are two ways to give this information to your devices. By Static IP Addresses & Dynamic IP Addresses.
Static IP Address is plugged into the computer manually…
In the same local network, if 2 active devices have the same IP address, then the problem arises where packets of a file are divided into two and each half is sent to one of the devices. There is nothing that can be recovered from the corrupted files.
The alternative way to send the preliminary network information required for establishing communication is through Dynamic IP Address.
What is Dynamic IP Address?
Dynamic IP Address means that when your computer connects to the network, it will call out to the DHCP server (therefore DHCP seems to be for dynamic IP addresses, not static). The DHCP server will give the computer an IP Address, tell it the Subnet Mask, Default Gateway, and DNS servers automatically. Also, DHCP servers will keep a record of addresses it has given out to make sure it hasn’t given out the same IP Address to multiple computers.
So basically DHCP allows for the automatic distribution of IP addresses & information for networking; connecting to the internet across multiple devices.
Computer calls out to DHCP server for IP Address. In the DHCP the scope of IP Address that are available is configured. DHCP server will only give out the IP Addresses within its scope. Scope is the full range of IP Addresses you allow the DHCP server to give out.
DHCP also gives back to the computer the Subnet Mask, Default Gateway, & DNS Server information. These pieces of information are given by the DHCP servers with lease times. Lease time is how long your computer is allowed to keep reserved an IP Address. Say the lease is given for 4 days. So after half of the time passes, 2 days, your computer try’s to automatically renew the IP Address by re-contacting the DHCP server. Then the lease is renewed for another 4 days, and the computer keeps the IP Address.
However, if at the 50% mark of the lease time and the computer cannot contact the DHCP server, then the computer will try to re-contact the DHCP server after 50% of the 50% ( => 75%) of the remaining time & so on, depending on the networking software installed on the computer. After a point, the software will either let go or keep the IP Address.
As soon as you plug in your computer to the internet, it will try to contact the DHCP Server.
The important thing to understand about DHCP servers is that after 50% lease time expires, the computer tries to contact the DHCP server. Then again after 50% of the remaining time. This makes a situation where shorter DHCP leases cause more network traffic, but allows for less IP Addresses to be reserved for computers that are not online. & vis versa…
NAT means Network Address Translation. NAT fixes the predisposed problem where every single device needs its own unique IP Address. For a Subnet Network, there may be duplicate IP Addresses on separate subnets, but NAT shows different IP Addresses externally. NAT treats each Subnet group as 1 external IP Address.
How Subnet Masking Works & Calculation
IP Addresses deal with 4 octets. Octets are series of 8 numbers.
_ _ _ _ _ _ _ _ . _ _ _ _ _ _ _ _ . _ _ _ _ _ _ _ _ . _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ = 8 bits that can be either 1 or 0 in each placement. On or Off
Each placement has a doubled value, compared to the one before (except the first one).
You start over, from doubling the value, to 1 at the beginning of each octet.
IP Address tells you two things. 1. is the address. IP Address tells you the identifier for the network & device.
Question: Which part is for network, which part is for computer or device? That’s what Subnet Mask tells you.
ie. 192.168.1.1 ← IP 184.108.40.206 ← Subnet Mask
Devices on different networks cannot talk to each other ie. Computer on Network 1 is physically connected to the same switch as printer, but printer is on Network 2.
To have 2 devices talk to each other from different Subnets requires a router.
So you can connect the printer & computer by router from the previous example.
Routers connect different subnets.
Subnet Mask tells you what part of the IP Address is for the Network, and what part is for device on the Network. Depends on how many networks your trying to make for how many devices you are shoving onto one network.
2n is an equation that will tell you how many subnets that you can have on 1 network. 2 to the power of how many bits you have used for the subnet. So let’s sya that you want ot use the first 8 bits out of the 4 octets for the subnet. It would be 2 to the power of 8. 28. That will tell you how many Subnets you have on a network.
Read ← for Networks; Read → for Hosts when looking at: _ _ _ _ _ _ _ _ . _ _ _ _ _ _ _ _ . _ _ _ _ _ _ _ _ . _ _ _ _ _ _ _ _
So if you are trying to find hosts, you have 2n – 2.
ie. Let’s say you want 254 hosts. That is using 8 bits from the first octet. So this is a class C Subnet. So it would be 28 – 2 = 254 hosts.
So you have to figure out how many Networks, or hosts you want. If you want to count how many networks you need, you need to count left to right.
To figure out how many hosts you need you need to count right to left.
ie. you need 508 hosts
255.0.0.0 = Subnet Mask
To figure out the Subnet Mask, you just add up all of the bits & numbers they represent.
→ 220.127.116.11 Subnet Mask
→ 18.104.22.168 Subnet Mask
A Class Subnet 22.214.171.124 | B Class Subnet 126.96.36.199 | C Class Subnet 188.8.131.52
Sometimes you don’t have to divide the IP address by the octet for Subnet Mask.
Let’s say you are given a whole Class C Subnet. You are in the office with a higher level network person who gave you 254 hosts, and a class C Subnet. 192.168.1.X | 184.108.40.206
You want to steal a few bits out of this class C Subnet. All you do is use the same number 225.225.225; But we only want to steal two bits from the last octet. Like this:
Now you can use those two bits to make 2 networks…