(1y ago)
Let's talk Computer Networks.
Peer-to-Peer | Client / Server |
---|---|
Equal opportunity to everyone in the network | Those who are in need only given option to talk with whom they want to talk. |
If the desired computer is busy in talking to other computer we can not talk to it at that time. | High speed data sharing can take place. |
Data-Link Layer also known as Layer-2.
Responsible for moving the data frames from one node to another node in the network from source to destination.
You can also call it Hop-to-Hop delivery of the data.
Data link layer has sublayers
LLC(Logical Link control) or DLC(Data Link Control) is responsible for Flow control
MAC sublayer is responsible for:
Service provided by Data link layer:
Frame = Header + Network Layer PDU(Data) + Trailer
Making each data frame that need to be transported unique or distinguishable from each other so that reciever can know what the data is.
Each frame of data is made unique by adding a header and trailer to the data that need to be sent over the channel.
The bits which are added at the begining and at the end of the frame is agreed by both sender and reciever.
We add bunch of bits at the begining and end of the data to mark one data frame. Below figure explains the Framing.
Notice how in the below figure we have the same header and trailer bit in the data part of the frame. It is called Framing error.
Framing Error solution:
Bit stuffing is used to overcome framing error problem
Let's say that 1001
is the agreed code to be added in header and trailer of the frame.
If we encounter 1001
we need to replace it with something else. Like say we replace it with 1011
and let the reciever know that it needs to be converted back to 1001
.
We might come across 1011
in the data. In this case the reciever will convert it into 1001
but it is not the correct data. To overcome this kind of problem we need to come up with a very strong and reliable bit stuffing code.
n
.
n
frmaes and wait for their acknowledgement in the order we sent the frames.k
parts of size n
.n
parts with each other and take 1's compliment.1
at all places then the recieved data is valid.CRC
.Random Access protocol | controlled access protocol | Channelization |
---|---|---|
Aloha | Reserving | FDMA |
CSMA | Polling | WDMA |
CSMA/CD | Token Passing | CDMA |
CSMA/CA |
232
devices.Class | Range | Usage | Subnet Mask | No of n/w | No of Hosts |
---|---|---|---|---|---|
A | 0-127 | General | 255.0.0.0 | 27 | 232-7-2 |
B | 128-191 | General | 255.255.0.0 | 217 | 232-14-2 |
C | 192-223 | General | 255.255.255.0 | 221 | 232-21-2 |
D | 224-239 | Broadcast | - | - | - |
E | 224-255 | /Research | - | - | - |
Subnet mask is used to identify the class of the address.
For each class the subnet is unique and can be identified in two ways:
Class | Binary notation | Slash notation |
---|---|---|
A | 00000000 | /8 |
B | 10000000 | /16 |
C | 11000000 | /24 |
The First and last address in each class os reserved and is not for Usage
127.0.0.0
for class-A
is used to identify the netowrk.localhost /127.0.0.1
IPV4 Transmission types:
unicast | multicast | broadcast |
---|---|---|
Can only talk to one device which is connected to the same network. | Can talk to multiple hosts in possible different networks. | Will talk to all the devices present in the network. |
It is impossible to give unique address to each device in the world.
Here the concept of private and public IP address comes into picture.
Devices which need not connect to the internet can use private IP addresses.
But, what if that device want to connect to the internet???
This can be achieved via connceting the device to a Proxy server or a router which has NAT setup init.
What NAT basically does is, It maps out the private IP address to public IP address of the router and handles the request.
Few Private IP addresses:
Address |
---|
10.0.0.0 - 10.255.255.255 (10.0.0.0/8 ) |
172.16.0.0 - 172.31.255.255 (172.16.0.0/12 ) |
192.168.0.0 - 192.168.255.255 (192.168.0.0/16 ) |
Formal name of classless addressing is known as CIDR(classless-Inter-domain-routing).
It allowes ISP to allocate IP address with any address bit-boundary(prefix length).
It allows us to create our own network with the number of devices needed in the network.
Subnetting:
Subnet masks:
network
and host
part of the IP address.32-bit
number constructed with all 1's at the begining and 0's at the end./
-notaion is used to represent the subnet mask/3
--> 11100000 00000000 00000000 00000000
There are few steps to be followed to calculate the number of IP addresses in a subnet
32
devices then we convert 32
into Binary format which is 100000
.n
. For the above example it will be 6
./
-notation, Just do 32 - n
./
-notation.Few protocols which network layer provides.
Socket-address = IP address + Port number
Error control and Flow control are defined in both Transport layer and Data Link Layer because:
Three-way-handshake connection mechanism:
Applications:
TCP | UDP |
---|---|
Transmission control Protocol | User datagram protocol |
Slower | Faster |
Reliable | Not Reliable |
Offers FLow control, Error control and congestion control | Do not offer FLow control, Error control and congestion control |
Connection Oriented Protocol | Not a connection Oriented Protocol |
Good Day 🐼