You must have used the term model a lot of times right? and in every scenario, it has a different meaning for example below you can see two models. An airplane model and a men model.
Now both of these models are different from each other but represent the idea of some greater picture.
That’s what network models are about they represent how the network works. now there are two Networking Models which we will cover
1. OSI seven-layer model
2. TCP-IP model
We will go in both of these in greater detail.
Now network works altogether with its uses hardware, software and other things now to make it work people come up with OSI seven-layer model, TCP-IP model which handles all of those things.
Let start with the OSI Model and first, we will discuss what is the purpose of each layer. As you can see its 7 layers modes and let’s start with the 1st layer.
It deals with physical stuff for example what cable to use and where you have plugged in the cables etc.
This layer is a little bit more important it deals with the MAC Addresses, Network cards, Switches.
Now, this layer is more important it has to deal with logical addresses like IP addresses. Routers work a layer 3.
Now data is big and the amount of data you can send in one packet on network is limited.So assembling and disassembling of those packets is done at this layer.It also makes sure packets reach another computer at the network.
Here we talk about the actual connection between two systems. What connection we are making TCP or UCP between the web server and client or send an email or FTP connection or just sharing data.
This layer deals with the data comping to your computer is that readable or not and if not make it readable.eg VLC player can run almost any video formate you don’t have to tell that it’s done automatically.
This layer deals with applications on our system for example browser and other related application which has all builtin functionalities dealing with the network. Like sending and receiving data to the network.
Now TCP -IP model is more simple than the OSI layer model because it won’t have to deal with a lot of parts of the OSI layer model.
Network Interface Layer:
This layer deals with all physical parts like cabling, MAC addresses, Network cards almost all the things that deal with hardware except routers. in terms of OSI its datalink and physical layer.
This layers deals with ip addressed almost everything with work with IP eg routers.
It does all the assembly and disassemble its also deals with what it takes to connect to other systems and make sure data gets there.eg TCP, UCP
It covers the OSI application, presentation and session layer. Every thing which deals with applications work at this layer. All the applications come in this area for example Emails ,FTP , Telnet.
What are Frames:
Let’s say your computer has a network card and its connected with a hub ( which can connect 8 pcs) now when you want to send or receive some data from and to other computers your network card will send a frame/packet.
In a sense of the definition, we can say devices on a network send and receive data in discrete chunks called frames or packets.
Frame is a max of 1500 bytes in size and do remember frames are cre4ated and destroyed inside the network interface. A frame consists of 0z and 1z i,e 111101010101001111011 … ( 1500 bytes=10 thousand 0z and 1z)
What is MAC Address:
Now we know frames are used to move data move arround and question is how did they select the pc to send that data well its done by MAC or physical address.
You can check your mac address by typing ipconfig in your cmd on windows a MAC is a 48bit address and can be written as MM:MM:MM:SS:SS:SS and in place of M or S can be any HEX value.
first 3 pairs M are known as OEM numbers Original Equipment Manufacturer this part defines which manufacturer of this network card eg intel and last three are different values (Unique ID) which is given to each network card at the factory. Every network card in existence has a different MAC.
That is why we add MAC addresses to the frame so that it can know which network card is its destination frame also has destination MAC address in case if data is corrupted it can request again.
Broadcast vs Unicast:
Well, it’s really simple suppose your PC got a frame and that frame has source and destination MAC address on it. PC will check if the destination MAC address is the same as your it will get the data because now PC knows its for me and save source MAC so that it can send back reply. Now, this is a Unicast example.
Now there are other situations when PC don’t know where it will send the data so transmission is sent to every pc connected on hub/switch(broadcast domain). so in simple words it send it to every devise in broadcast domain.
Now is case of MAC address we just can not apply it to big networks so we have to apply logical addressing.
so that is why we use ip addressing and it is used to identify a network. for example, we have two networks connected to each other as given in the picture below.
Now PC0 and PC1 are in the same network and both of them will have ip starting as same and the last part of IP will be different. 18.104.22.168 , 22.214.171.124.
and PC3, PC4 will have the same IP starting portion and last part different 126.96.36.199, 110,14,56,6.
Now if network 1 will receive a frame to send it to any pc if is 32.44.17 series it knows its for me but if its from other series which is 110.14.46 it will know its not for my network and it will trigger the Default Gateway which is a connection to the router and send it to the router.
Port Numbers and Packets:
When you are browsing the internet you have a lot of tabs open and skype or other applications how pc know which data belongs to which application well it’s done with a post number.
Each application has a unique port number and each packet has a port number in it your pc sends data to that post number using the application and as a return, it sends data back to your pc port.
In total there are 0-65535 ports first 1024 are reserved for applications that are required and others can be attached to different processes.
now the other problem is how did pc know how much this data is well that’s where TCP comes in it divides the data into small parts and gives then sequence numbers and once the receiver has received it give acknowledge number that ok got it.
well, how you enjoyed reading this keep reading and I will see you in the next post which continues of this one.