Pages

Saturday, 28 September 2024

Channelization Protocol

It is a channelization protocol that allows the total usable bandwidth in a shared channel to be shared across multiple stations based on their time, distance and codes. It can access all the stations at the same time to send the data frames to the channel.Following are the various methods to access the channel based on their time, distance and codes:

FDMA (Frequency Division Multiple Access)
TDMA (Time Division Multiple Access)
CDMA (Code Division Multiple Access)

Frequency Division Multiple Access (FDMA): FDMA is a type of channelization protocol. This bandwidth is divided into various frequency bands. Each station is allocated a band to send data and that band is reserved for the particular station for all the time which is as follows.

The frequency bands of different stations are separated by small bands of unused frequency and unused frequency bands are called as guard bands that prevent the interference of stations. 

It is like the access method in the data link layer in which the data link layer at each station tells its physical layer to make a bandpass signal from the data passed to it. The signal is created in the allocated band and there is no physical multiplexer at the physical layer. 
Time Division Multiple Access (TDMA) : TDMA is the channelization protocol in which bandwidth of channel is divided into various stations on the time basis. There is a time slot given to each station, the station can transmit data during that time slot only which is as follows.

Each station must aware of its beginning of time slot and the location of the time slot. 

TDMA requires synchronization between different stations. 

It is type of access method in the data link layer. At each station data link layer tells the station to use the allocated time slot. 

Code Division Multiple Access (CDMA) : In CDMA, all the stations can transmit data simultaneously. It allows each station to transmit data over the entire frequency all the time. Multiple simultaneous transmissions are separated by unique code sequence. Each user is assigned with a unique code sequence.

In the below figure, there are 4 stations marked as 1, 2, 3 and 4. Data assigned with respective stations as d1, d2, d3 and d4 and the code assigned with respective stations as c1, c2, c3 and c4. 

Special property of the assigned code in CDMA is :
1.Multiply each code by another we get 0
2.Multiply each code by itself we get 4

For Example: Suppose station 2 wants to receive the data from station 1 then the data = (d1.c1+d2.c2 + d3.c3 +d4.c4) . c1
             = d1.c1.c1+d2.c2.c1 + d3.c3.c1 +d4.c4.c1
             = d1.4+d2.0 + d3.0 +d4.0
             = d1.4
therefore the data = d1.4/total no of station
                           = d1.4/4
                           = d1

Chip Sequence: CDMA is based on coding theory, sequence of numbers is called as code and they are called as chips, so they are called chip sequence
c1 = [ +1+1+1 +1 ]
c2 = [ +1 -1 +1 -1 ]
c3 = [ +1 +1 -1 -1 ]
c4 = [ +1 -1 -1 +1 ]

Properties of Chip Sequence:
1. Each sequence is made up of N elements, where N is Number of station

2.Multiply a sequence by a number i.e 2 . c3
     2 . [ +1 +1 -1 -1 ]
     [ +2 +2 -2 -2 ]

3.Multiply two equal sequences i.e c3 .c3
     [ +1 +1 -1 -1 ] . [ +1 +1 -1 -1 ]
     [ +1 +1 +1 +1 ]
     [  4 ]

4.Multiply two different sequences i.e c3 .c1
     [ +1 +1 -1 -1 ] . [ +1 +1 +1 +1 ]
     [ +1 +1 -1 -1 ]
     [  0 ]
5.Adding two sequences i.e c3 + c1
     [ +1 +1 -1 -1 ] + [ +1 +1 +1 +1 ]
     [ +2 +2  0  0 ]
   
Data Representation in CDMA:
Data bit 0 -> -1
Data bit 1 -> +1
Data bit Silent -> 0

consider the data bit across station 1 is 0 = -1
i.e  d1 . c1
     -1 . [ +1+1+1+1]
    -1 -1 -1 -1 

consider the data bit across station 2 is 0 = -1
i.e  d2 . c2
     -1 . [ +1 -1 +1 -1 ]
    -1 +1 -1 +1 

consider the data bit across station 3 is Silent = 0
i.e  d3 . c3
     0 .  [ +1 +1 -1 -1 ]
    0 0 0 0 

consider the data bit across station 4 is 1 = +1
i.e  d4 . c4
     +1 .  [ +1 -1 -1 +1 ]
    +1 -1 -1 +1


Sum of all four sequences is
[  -1 -1 -1 -1 ] + [ -1 +1 -1 +1 ] + [ 0 0 0 0 ] + [ +1 -1 -1 +1 ]
[ (-1-1+0+1)  (-1+1+0-1)  (-1-1+0-1)  (-1+1+0+1)  ]
[ (-1)  (-1)  (-3)  (+1)  ]

For Example: Suppose if station 3 wants to receive the data from station 2 then the data = (d1.c1+d2.c2 + d3.c3 +d4.c4) . c2
             = [ (-1)  (-1)  (-3)  (+1)  ] . [ +1 -1 +1 -1 ]
             = [ -1+1-3-1  ] 
             = [ -4 ]
therefore the data = -4/4
                           = -1
                           = 0
Hence the bit 0 is received from the station 2 

For Example: Suppose if station 1 wants to receive the data from station 4 then the data = (d1.c1+d2.c2 + d3.c3 +d4.c4) . c4
             = [ (-1)  (-1)  (-3)  (+1)  ] . [ +1 -1 -1 +1 ]
             = [ -1+1+3+1  ] 
             = [ +4 ]
therefore the data = +4/4
                           = +1
                           = 1
Hence the bit 1 is received from the station 4

Controlled Access Protocol

It is a method of reducing data frame collision on a shared channel. In the controlled access method, each station interacts and decides to send a data frame by a particular station approved by all other stations. It means that a single station cannot send the data frames unless all other stations are not approved. It has three types of controlled access: 

  1. Reservation
  2. Polling
  3. Token Passing.
1. Reservation
In the reservation method, a station needs to make a reservation before sending data.

The timeline has two kinds of periods:
Reservation interval of fixed time length
Data transmission period of variable frames.

If there are M stations, the reservation interval is divided into M slots, and each station has one slot.

Suppose if station 1 has a frame to send, it transmits 1 bit during the slot 1. No other station is allowed to transmit during this slot.

In general, i th station may announce that it has a frame to send by inserting a 1 bit into i th slot. After all N slots have been checked, each station knows which stations wish to transmit.

The stations which have reserved their slots transfer their frames in that order.
After data transmission period, next reservation interval begins.

Since everyone agrees on who goes next, there will never be any collisions.

The following figure shows a situation with five stations and a five-slot reservation frame. In the first interval, only stations 1, 3, and 4 have made reservations. In the second interval, only station 1 has made a reservation.
2. Polling
Polling process is similar to the roll-call performed in class. Just like the teacher, a controller sends a message to each node in turn.

In this, one acts as a primary station(controller) and the others are secondary stations. All data exchanges must be made through the controller.

The message sent by the controller contains the address of the node being selected for granting access.

Although all nodes receive the message the addressed one responds to it and sends data if any. If there is no data, usually a “poll reject”(NAK) message is sent back.

Problems include high overhead of the polling messages and high dependence on the reliability of the controller.
3. Token Passing
In token passing scheme, the stations are connected logically to each other in form of ring and access to stations is governed by tokens.

A token is a special bit pattern or a small message, which circulate from one station to the next in some predefined order.

In Token ring, token is passed from one station to another adjacent station in the ring whereas incase of Token bus, each station uses the bus to send the token to the next station in some predefined order.

In both cases, token represents permission to send. If a station has a frame queued for transmission when it receives the token, it can send that frame before it passes the token to the next station. If it has no queued frame, it passes the token simply.

After sending a frame, each station must wait for all N stations (including itself) to send the token to their neighbours and the other N – 1 stations to send a frame, if they have one.

There exists problems like duplication of token or token is lost or insertion of new station, removal of a station, which need be tackled for correct and reliable operation of this scheme.

CSMA (Carrier Sense Multiple Access)

It is a carrier sense multiple access based on media access protocol to sense the traffic on a channel (idle or busy) before transmitting the data. It means that if the channel is idle, the station can send data to the channel. Otherwise, it must wait until the channel becomes idle. Hence, it reduces the chances of a collision on a transmission medium.

CSMA Access Modes
1-Persistent: In the 1-Persistent mode of CSMA that defines each node, first sense the shared channel and if the channel is idle, it immediately sends the data. Else it must wait and keep track of the status of the channel to be idle and broadcast the frame unconditionally as soon as the channel is idle.

Non-Persistent: It is the access mode of CSMA that defines before transmitting the data, each node must sense the channel, and if the channel is inactive, it immediately sends the data. Otherwise, the station must wait for a random time (not continuously), and when the channel is found to be idle, it transmits the frames.

P-Persistent: It is the combination of 1-Persistent and Non-persistent modes. The P-Persistent mode defines that each node senses the channel, and if the channel is inactive, it sends a frame with a P probability. If the data is not transmitted, it waits for a (q = 1-p probability) random time and resumes the frame with the next time slot.
CSMA/ CD
It is a carrier sense multiple access/ collision detection network protocol to transmit data frames. The CSMA/CD protocol works with a medium access control layer. Therefore, it first senses the shared channel before broadcasting the frames, and if the channel is idle, it transmits a frame to check whether the transmission was successful. If the frame is successfully received, the station sends another frame. If any collision is detected in the CSMA/CD, the station sends a jam/ stop signal to the shared channel to terminate data transmission. After that, it waits for a random time before sending a frame to a channel.

Working of CSMA/CD
Step 1: Check if the sender is ready to transmit data packets.

Step 2: Check if the transmission link is idle. 
The sender has to keep on checking if the transmission link/medium is idle. For this, it continuously senses transmissions from other nodes. The sender sends dummy data on the link. If it does not receive any collision signal, this means the link is idle at the moment. If it senses that the carrier is free and there are no collisions, it sends the data. Otherwise, it refrains from sending data.

Step 3: Transmit the data & check for collisions. 
The sender transmits its data on the link. CSMA/CD does not use an ‘acknowledgment’ system. It checks for successful and unsuccessful transmissions through collision signals. During transmission, if a collision signal is received by the node, transmission is stopped. The station then transmits a jam signal onto the link and waits for random time intervals before it resends the frame. After some random time, it again attempts to transfer the data and repeats the above process.

Step 4: If no collision was detected in propagation, the sender completes its frame transmission and resets the counters.

How Does a Station Know if Its Data Collide?  
Consider the above situation. Two stations, A & B. 
Propagation Time: Tp = 1 hr ( Signal takes 1 hr to go from A to B) 

At time t=0, A transmits its data.
        t= 30 mins : Collision occurs.

After the collision occurs, a collision signal is generated and sent to both A & B to inform the stations about the collision. Since the collision happened midway, the collision signal also takes 30 minutes to reach A & B. 

Therefore, t=1 hr: A & B receive collision signals.

This collision signal is received by all the stations on that link. Then, How to Ensure that it is our Station’s Data that Collided? 
For this, Transmission time (Tt) > Propagation Time (Tp) [Rough bound] 
This is because we want that before we transmit the last bit of our data from our station, we should at least be sure that some of the bits have already reached their destination. This ensures that the link is not busy and collisions will not occur. 
But, above is a loose bound. We have not taken the time taken by the collision signal to travel back to us. For this consider the worst-case scenario. Consider the above system again. 
Collision detection in CSMA/CD

At time t=0, A transmits its data.
        t= 59:59 mins : Collision occurs

This collision occurs just before the data reaches B. Now the collision signal takes 59:59 minutes again to reach A. Hence, A receives the collision information approximately after 2 hours, that is, after 2 * Tp.  

Hence, to ensure tighter bound, to detect the collision completely,
  Tt  >= 2 * Tp  
This is the maximum collision time that a system can take to detect if the collision was of its own data. 

Transmission Time = Tt = Length of the packet/ Bandwidth of the link 
[Number of bits transmitted by sender per second] 

Substituting above, we get, 
Length of the packet/ Bandwidth of the link >= 2 * Tp 
Length of the packet >= 2 * Tp * Bandwidth of the link

Efficiency:
CSMA/ CA
It is a carrier sense multiple access/collision avoidance network protocol for carrier transmission of data frames. It is a protocol that works with a medium access control layer. 

CSMA/CA protocol is used in wireless networks because they cannot detect the collision so the only solution is collision avoidance.
CSMA/CA avoids the collisions using three basic technique.
1. Interframe Space
2. Contention window
3. Acknowledgements


1. Interframe Space(IFS)
• Whenever the channel is found idle, the station does not transmit immediately. It waits for a period of time called interframe space(IFS).

• When channel is sensed to be idle, it may be possible that same distant station may have already started transmitting and the signal of that distant station has not yet reached other stations.

• Therefore the purpose of IFS time is to allow this transmitted signal to reach other stations.

• If after this IFS time, the channel is still idle, the station can send, but it still needs to wait a time equal to contention time.

• IFS variable can also be used to define the priority of a station or a frame.

2.Contension window : It is an amount of time divided into slots.
• A station that is ready to send chooses a random number of slots as its wait time.

• The number of slots in the window changes according to the binary exponential back-off strategy. It means that is set of one slot the first time and then double each time the station cannot detect an idle channel after the IFS time.

• This is very similar to the p-persistent method except that a random outcome defines the number of slots taken by the waiting station.

• In contension window the station needs to sense the channel after each item slot.

• If the station finds the channel busy, it does not restart the process. It just stops the timer and restarts it when the channel is sensed as idle. 

3.Acknowledgement :
• Despite all the precautions, collisions may occur and destroy the data.

• The positive acknowledgement and the time-out timer can help guarantee that receiver has received the frame.

Difference between CSMA/CD and CSMA/CA :

  CSMA / CD

CSMA / CA

It is the type of CSMA to detect the collision on a shared channel.

It is the type of CSMA to avoid collision on a shared channel.

It is the collision detection protocol.

It is the collision avoidance protocol.

It is used in 802.3 Ethernet network cable.

It is used in the 802.11 Ethernet network.

It works in wired networks.

It works in wireless networks.

It is effective after collision detection on a network.

It is effective before collision detection on a network.

Whenever a data packet conflicts in a shared channel, it resends the data frame.

Whereas the CSMA CA waits until the channel is busy and does not recover after a collision.

It minimizes the recovery time.

It minimizes the risk of collision.

The efficiency of CSMA CD is high as compared to CSMA.

The efficiency of CSMA CA is similar to CSMA.

It is more popular than the CSMA  CA protocol.

It is less popular than CSMA CD.



Friday, 27 September 2024

E-Mail Server using CPT

The email refers to the electronic means of communication of sending and receiving messages over the Internet.

Components of an Email:

Sender: The sender creates an email in which he records the information that needs to be transferred to the receiver.

Receiver: The receiver gets the information sent by the sender via email.

Email address: An email address is just like a house address where the communication arrives for the sender and receiver and they communicate with each other.

Mailer: The mailer program contains allows the ability to read, write, manage and delete the emails like Gmail, Outlook, etc.

Mail Server: The mail server is responsible for sending, receiving, managing, and recording all the data proceeded by their respective mail programs and then processing them to their respective users.

SMTP: SMTP stands for Simple mail transfer protocol. SMTP basically uses the internet network connection to send and receive email messages over the Internet.

Protocols of Email:Emails basically use two types of standard protocols for communication over the Internet. They are:

POP: POP stands for post office protocol for email. Similar to a post office, our approach is just to drop the email over the service mail provider and then leave it for services to handle the transfer of messages. We can be even disconnected from the Internet after sending the email via POP. Also, there is no requirement of leaving a copy of the email over the web server as it uses very little memory. POP allows using concentrate all the emails from different email addresses to accumulate on a single mail program. Although, there are some disadvantages of POP protocol like the communication medium is unidirectional, i.e it will transfer information from sender to receiver but not vice versa.

IMAP: IMAP stands for Internet message access protocol. IMAP has some special advantages over POP like it supports bidirectional communication over email and there is no need to store conversations on servers as they are already well-maintained in a database. It has some advanced features like it tells the sender that the receiver has read the email sent by him.

Working of Email:

When the sender sends the email using the mail program, then it gets redirected to the simple mail transfer protocol which checks whether the receiver’s email address is of another domain name or it belongs to the same domain name as that of the sender (Gmail, Outlook, etc.). Then the email gets stored on the server for later purposes transfer using POP or IMAP protocols.

If the receiver has another domain name address then, the SMTP protocol communicates with the DNS (domain name server) of the other address that the receiver uses. Then the SMTP of the sender communicates with the SMTP of the receiver which then carries out the communication and the email gets delivered in this way to the SMTP of the receiver.

If due to certain network traffic issues, both the SMTP of the sender and the receiver are not able to communicate with each other, the email to be transferred is put in a queue of the SMTP of the receiver and then it finally gets receiver after the issue resolves. And if due to very bad circumstances, the message remains in a queue for a long time, then the message is returned back to the sender as undelivered.




OUTPUT:



Monday, 16 September 2024

Random Access: ALOHA

ALOHA is a simple communication protocol used in computer networks, specifically in wireless systems. Developed in the 1970s at the University of Hawaii, ALOHA was designed for data communication over radio waves.
ALOHA is a contention-based protocol, where multiple users share a communication medium (e.g., a wireless channel). The protocol allows devices to send data whenever they have data to transmit, without prior coordination.
There are two primary versions of ALOHA: 
  1. Pure ALOHA 
  2. Slotted ALOHA.
1. Pure ALOHA:
In Pure ALOHA, any device can send data whenever it has data to send. The downside of this approach is that data packets can collide if more than one device transmits simultaneously. 

These collisions lead to data loss and require retransmissions. 

To manage collisions, the sender waits a random amount of time before attempting to resend the data. 

The maximum throughput of Pure ALOHA is 18.4%, meaning only 18.4% of the channel’s capacity is effectively utilized due to collisions.

Vulnerable Time of pure ALOHA
Vulnerable time is the time in which the collision of data packets occurs. If the first frame ‘B’ is sent at any particular time t , before the data is transmitted completely and the other frame ‘A’ starts before the completion of frame ‘B’ will lead to a collision.
Where T is the Transmission time of the frame  Tt
The vulnerable time when the collision occurs (Vt) = [(t+Tt) -(t-Tt)]
                                                                         = t+Tt - t+Tt
                                                                         = 2 * Tt 

Vulnerable time is also referred to as the propagation time or total time taken to transmit the complete data packet from the station.

Vulnerabletime=(Message Length) / (Transmission channel bandwidth)

Channel Throughput of Pure ALOHA
Here ‘G’ is the average number of frames transmitted through the channel during a period of one frame transmission. When the data packet is successfully or completely transmitted to the receiver end, the probability of the data packet is given below,


Maximum Efficiency
To find the maximum efficiency of the station during the data packet transmission

The Efficiency of Pure ALOHA in percentage is 18.4% and is very less due to the number of collisions.

2. Slotted ALOHA:
Slotted ALOHA improves the efficiency by introducing time slots. Devices can only send data at the beginning of each slot. 

This reduces the likelihood of collisions because transmissions are aligned to discrete time intervals.

The throughput of Slotted ALOHA is higher than Pure ALOHA, reaching about 36.8%.

Vulnerable Time of slotted ALOHA
Vulnerable time is the time is the Transmission time of the frame  Tt
The vulnerable time (Vt) = Tt 

Channel Throughput of Slotted ALOHA
Here ‘G’ is the average number of frames transmitted through the channel during a period of one frame transmission. When the data packet is successfully or completely transmitted to the receiver end, the probability of the data packet is given below,

Maximum Efficiency
To find the maximum efficiency of the station during the data packet transmission


Difference between Pure ALOHA AND Slotted ALOHA

Sunday, 8 September 2024

DHCP Configuration Using CPT

Dynamic Host Configuration Protocol (DHCP) is a network management protocol used to dynamically assign an IP address to many device, or node, on a network so they can communicate using IP (Internet Protocol). DHCP automates and centrally manages these configurations. There is no need to manually assign IP addresses to new devices. Therefore, there is no requirement for any user configuration to connect to a DHCP based network.

DHCP can be implemented on local networks as well as large enterprise networks. DHCP is the default protocol used by the most routers and networking equipment. DHCP is also called RFC (Request for comments) 

DHCP does the following:
DHCP manages the provision of all the nodes or devices added or dropped from the network.
DHCP maintains the unique IP address of the host using a DHCP server. It sends a request to the DHCP server whenever a client/node/device, which is configured to work with DHCP, connects to a network. The server acknowledges by providing an IP address to the client/node/device.
DHCP is also used to configure the proper subnet mask, default gateway and DNS server information on the node or device.


How DHCP works
DHCP runs at the application layer of the TCP/IP protocol stack to dynamically assign IP addresses to DHCP clients/nodes and to allocate TCP/IP configuration information to the DHCP clients. Information includes subnet mask information, default gateway, IP addresses and domain name system addresses.

DHCP is based on client-server protocol in which servers manage a pool of unique IP addresses, as well as information about client configuration parameters, and assign addresses out of those address pools.

The DHCP lease process works as follows:
First of all, a client (network device) must be connected to the internet.
DHCP clients request an IP address. Typically, client broadcasts a query for this information.
DHCP server responds to the client request by providing IP server address and other configuration information. This configuration information also includes time period, called a lease, for which the allocation is valid.
When refreshing an assignment, a DHCP clients request the same parameters, but the DHCP server may assign a new IP address. This is based on the policies set by the administrator.

Components of DHCP
DHCP Server: DHCP server is a networked device running the DHCP service that holds IP addresses and related configuration information. 

DHCP client: DHCP client is the endpoint that receives configuration information from a DHCP server. This can be any device like computer, laptop, IoT endpoint or anything else that requires connectivity to the network. 

IP address pool: IP address pool is the range of addresses that are available to DHCP clients. IP addresses are typically handed out sequentially from lowest to the highest.

Subnet: Subnet is the partitioned segments of the IP networks. Subnet is used to keep networks manageable.

Lease: Lease is the length of time for which a DHCP client holds the IP address information. When a lease expires, the client has to renew it.

DHCP relay: A host or router that listens for client messages being broadcast on that network and then forwards them to a configured server. The server then sends responses back to the relay agent that passes them along to the client. DHCP relay can be used to centralize DHCP servers instead of having a server on each subnet.

Benefits of DHCP
Centralized administration of IP configuration: DHCP IP configuration information can be stored in a single location and enables that administrator to centrally manage all IP address configuration information.

Dynamic host configuration: DHCP automates the host configuration process and eliminates the need to manually configure individual host. When TCP/IP (Transmission control protocol/Internet protocol) is first deployed or when IP infrastructure changes are required.

DHCP automates the host configuration PC0 process automatically with the following IPs

Finally the output of PC0,PC1,PC2,PC3 dynamically allocated address as shown below:

Peer-to-Peer Networks

  Peer-to-Peer (P2P) networks are a decentralized type of network architecture where each device (or node) on the network can act as both a...