Introduction To TCP Congestion Control

Congestion window and a congestion policy that avoid congestion is used by TCP at transport layer.
                     If the network cannot deliver the data as fast as it is created by the sender, it must tell the sender to slow down. In other words, in addition to the receiver, the network is a second entity that determines the size of the sender’s window.

TCP congestion control Algorithm 
Slow Start Phase: starts slowly with 1MSS and grow till the  threshold in exponential manner.
Congestion Avoidance Phase: After reaching the threshold increment is by 1 till you reached the max receiver window size.
Congestion Detection Phase: Sender goes back to Slow start phase or Congestion avoidance phase.i.e

1) Retransmission due to Timeout – In this case congestion possibility is high.

(a) ssthresh is reduced to half of the current window size.
(b) set cwnd = 1
(c) start with slow start phase again.

2) Retransmission due to 3 Acknowledgement Duplicates – In this case congestion possibility is less.

(a) ssthresh value reduces to half of the current window size.
(b) set cwnd= ssthresh
(c) start with congestion avoidance phase

 

 

Example:

WR=64KB

MSS=1KB

Sol:

WR=64MSS

Threshold=32MSS

1 2 4 8 16 32(threshold arrive) 33 34 35 ------------------------------64

now suppose at MSS 34 TO occure then Threshold =floor(Wc/2)

       i.e 17 now slow start phase start with threshold 17 

1 2 4 8 16 17 18 19 20

now at MSS 20  3 duplicate acknowldegement occure the threshold =floor(Wc/2)

sender window size will be equl to threshold i.e 10 and start in congestion Avoidance phase

10 11 12 13...........................

Contributor's Info

Created:
0Comment
Retransmission in TCP

Tcp use both SR(selective repeat) and GBN (Go backN).Actually it is 75% SR and 25% GBN. In case of acknowledgement it is GBN because of cummulative acknowledgement.

Now it is SR also because it have equal sender window size and receiver window size and along with this it can accept out of order packet.

 

Re transmission after TO:

Here assume that we have send one segment and it get lost.

 

 

 

Suppose ,now  if we have send 5 segment and second segment get lost and rest are accepted then there is a concept of early retransmission come to the picture  i.e  retransmit before time out. It is also called as Retransmission after three duplicate acknowledgement.

 

 

If all three duplicate acknowledgement lost or any of them lost the time out will occure and this can be handled.

Contributor's Info

Created:
0Comment
Connection Termination In TCP

Client has sent FIN segment to the server and moves to FIN-WAIT-1,i.e. waiting for ACK for own FIN segment.There are two possibilities here:

1)If Client receives ACK for its FIN then client will move to FIN WAIT-2 and will wait for matching FIN from server side .After receiving the FIN from server,client will send ACK and move to TIME-WAIT sate.

 

2)Client has sent FIN segment but didn't get ACK till the time.Instead of ACK ,client received FIN from server side.client will acknowledge this FIN and move to CLOSE state.Here Client will wait for the ACK for its own FIN. After receiving ACK ,client will move to TIME-WAIT state.

Contributor's Info

Created:
0Comment
Connection establishment In TCP

TCP is a connection oriented protocol and every connection oriented protocol needs to establish connection in order to reserve resources at both the communicating ends.

Connection Establishment –

 

 

Sender starts the process with following:

Sequence number (Seq=521): contains the random initial sequence number which generated at sender side.

Syn flag (Syn=1): request receiver to synchronize its sequence number with the above provided sequence number.

Maximum segment size (MSS=1460 B): sender tells its maximum segment size, so that receiver sends datagram which won’t require any fragmentation. MSS field is present inside Option field in TCP header.

Window size (window=14600 B): sender tells about his buffer capacity in which he has to store messages from receiver.

TCP is a full duplex protocol so both sender and receiver require a window for receiving messages from one another.

 

Sequence number (Seq=2000): contains the random initial sequence number which generated at receiver side.

Syn flag (Syn=1): request sender to synchronize its sequence number with the above provided sequence number.

Maximum segment size (MSS=500 B): sender tells its maximum segment size, so that receiver sends datagram which won’t require any fragmentation. MSS field is present inside Option field in TCP header.
Since MSSreceiver < MSSsender, both parties agree for minimum MSS i.e., 500 B to avoid fragmentation of packets at both ends.

Therefore, receiver can send maximum of 14600/500 = 29 packets. This is the receiver's sending window size.

Window size (window=10000 B): receiver tells about his buffer capacity in which he has to store messages from sender.

Therefore, sender can send a maximum of 10000/500 = 20 packets. This is the sender's sending window size.

Acknoledgement Number (Ack no.=522): Since sequence number 521 is received by receiver so, it makes a request of next sequence number with Ack no.=522 which is the next packet expected by receiver since Syn flag consumes 1 sequence no.

ACK flag (ACk=1): tells that acknowledgement number field contains the next sequence expected by receiver.

Sender makes the final reply for connection establishment in following way:

Sequence number (Seq=522): since sequence number = 521 in 1st step and SYN flag consumes one sequence number hence, next sequence number will be 522.

Acknowledgement Number (Ack no.=2001): since sender is acknowledging SYN=1 packet from the receiver with sequence number 2000 so, the next sequence number expected is 2001.

ACK flag (ACK=1): tells that acknowledgement number field contains the next sequence expected by sender.

 

Contributor's Info

Created:
0Comment
Wrap around time and problem on wrap around time

Wrap Around : It is nothing but using up all the sequence number present and reusing the same sequence number which has already been used that is called wrap around and from this we get a time called as wrap around time.

 

let band width is 1MBps,

that means in 1 sec i can have 1MB data

⇒106B  in  1 sec

⇒106 Seq number in 1 sec 

⇒1 Seq number in 1/106 sec 

∴  for 232 seq num we have 232/106 sec

⇒ WAT= 4294967296/106

WAT=4294.967296sec

we know that life time of a packet is 180 sec.

      therefor to reuse a seq num       WAT>LT

Now take Bandwidth as 1GBps

 

that means in 1 sec i can have 1GB data

⇒109B  in  1 sec

⇒109 Seq number in 1 sec 

⇒1 Seq number in 1/109sec 

∴  for 232 seq num we have 232/109sec

               WAT= 4294967296/109

            WAT=4.294967296sec

here WAT<LT  

when first packet is still alive with some sequence no we are generating more packet with same seq no.  then at destination there are many packet which are having same seq no.( for eg.100 ) and the destination doesn't know which is 1st 100,2nd 100 etc.so its a problem.

solution to this problem is to increase the no of seq number

band width is 1MBps,

LT=180 sec

1 sec--------1 GB

109------------1sec

or 

1 sec----------1G seq num

180 sec ----------180*1G seq num

 

min seq num required to avoid Wrap around with in LT

=180*1G seq num

ceil(log2 180*109 )

42 bit

so we need 10 bit extra and these bits  can be get from option field in the header.

 

Contributor's Info

Created:
0Comment
Fermat's Theorem

Fermat little theorem :

The public key ,private key  cryptography is based on prime number.

 

Fermat's little theorem states that if p is a prime number, then for any integer a, the number ap − a is an integer multiple of p. In the notation of modular arithmetic, this is expressed as. For example, if a = 2 and p = 7, then 27 = 128, and 128 − 2 = 126 = 7 × 18 is an integer multiple of 7

or we can say ,

ap-1≅ 1(modp)

or ap≅ a(modp)

 

Example:

P = an integer Prime number

a = an integer which is not multiple of P

Let a = 2 and P = 17

According to Fermat's little theorem 2 17 - 1 ≡ 1 mod(17) we got 65536 % 17 ≡ 1 that mean (65536-1) is an multiple of 17

Contributor's Info

Created:
0Comment
Network Security and Some Impotent Terms

                                                          Network Security
a. Message Confidentiality (Privacy)
The transmitted message must make sense to only the intended receiver. To all others, the message must be garbage.
b. Message Integrity
Message integrity means that the data must arrive at the receiver exactly as they were sent.
There must be no changes during the transmission, neither accidentally nor maliciously. As more and more monetary exchanges occur over the Internet, integrity is crucial.
c. Message Authentication
In message authentication the receiver needs to be sure of the sender's identity and that an  imposter has not sent the message.
d. Message Nonrepudiation
A sender must not be able to deny sending a message that he or she, in fact, did send. For example, when a customer sends a message to transfer money from one account to another, the bank must have proof that the customer actually requested this transaction.
e. Entity Authentication
The entity or user is verified prior to access to the system resources.

 

 

Some point related to network security

a. A(n) message digest can be used to preserve the integrity of a document or a message.
b. A(n) hash function creates a message digest out of a message.
c. A conventional signature is included in the document; a digital signature is a separate entity.

d. Digital signature can provide Authentication, Nonrepudiation,Integrity 

e. If confidentiality is needed, a cryptosystem must be applied over the scheme.
f. The secret key between members needs to be created as a session key when two members contact KDC.

 

 

Digital Signature:
Although a MAC (message authentication code) use a keyed hash function which can provide message integrity and message authentication, it has a drawback. It needs a symmetric key that must be established between the sender and the receiver.
A digital signature can use a pair of asymmetric keys (a public one and a private one) which proves authenticity of sender.

Inclusion
A conventional signature is included in the document; it is part of the document. When we sign a document digitally, we send the signature as a separate document. The sender sends two documents: the message and the signature. The recipient receives both documents and verifies that
the signature belongs to the supposed sender. If this is proved, the message is kept; otherwise, it is rejected.

 

Verification Method
In conventional signature, when the recipient receives a document, she compares the signature on the document with the signature on file. If they are the same, the document is authentic. The recipient needs to have a copy of this signature on file for comparison. In digital signature, the recipient receives the message and the signature. A copy of the signature is not stored anywhere.
The recipient needs to apply a verification technique to the combination of the message and the signature to verify the authenticity.

Relationship
In conventional signature, there is normally a one-to-many relationship between a signature and documents. A person, for example, has a signature that is used to sign many checks, many documents, etc. In digital signature, there is a one-to-one relationship between a signature and a message. Each message has its own signature. The signature of one message cannot be used in
another message

 

                  “In digital signature, the signer uses his/ her private key, applied to a signing algorithm, to sign the document. The verifier, on the other hand, uses the public key of the signer, applied to the verifying algorithm, to verify the document.” 

Contributor's Info

Created:
0Comment
Introduction to Access control method

Access control methods are the methods used for providing access control.

1) They prevent the collision or deal with it and ensures smooth flow of traffic on the network.

2) They are implemented at the data link layer of the OSI reference model.

1) Time Division Multiplexing: we are reserving the slots for some station bcz of this there could be the dis advantage.we assume that transmission time Ttof each station is same.

η=usefull time/cycle time

=Tt/Tt +Tp

η=1/1+a ,where a=Tp/Tt

 

Disadvantage of TDM :reservation ,whenever a station get a chance to transmit which means it gets the slots but it doesn't have any data to send,so that entire slot is going to be waste.

 

2) Polling: one station if it get access to the link,it has to participate to polling for which some time is wasting and then it get chance to transmit and propogate through the channel.

η=usefull time/cycle time

η=Tt/Tt +Tp+Tpoll 

 

3) CSMA/CD(Carrier Sensing Multiple Access/Collision Detection):

a) any station can send data at any time and multiple station is connected to channel.

b)before sending any data every station is suppose to sense the carrier ,if the carrier is free you can send the data otherwise not.

c)There is no ack in CSMA/CD,Which means when you are sending a data and if your data is lost in collision,it is the responsibility of sender to detect that it is a collision and to retransmit the packet.

                                        So in order to detect collision ,in worst case we should keep transmitting the data untill we get back the collision signal if any.

                                                     L ≥ 2*Tp*B

       This is the min size of packet inorder to detect the collision.

now efficiency of csma/cd or ethernet both are equal and is:

                                                   η=1/1+6.44a

 

4) Token Passing: In token passing advantage is we are not going to have collision ,reason is:

a) transmission will be in unidirection.

b)At a time only one station can transmitt the packet and that station should have token.

 η=usefull time/cycle time

cycle time in token passing  is,The time taken by the token to start  at a point in the ring and again come back to the same point is called cycle time.

cycle time =(d/v +N*THT)

THT=token holding time

token holding time is depend on two strategies we are going to use here.

  • Delay token re insertion
  • Early token re insertion

1)Delay token reinsertion:

THT = Tt+RL(ring latency)

     THT     =Tt+Tp

 

η = N*Tt   /(Tp+N(Tt  + Tp))

 

η = 1/1+((N+1)a)/N

 

2) Early token re insertion:

 

THT= Tt  

because after transmission ,station will release the token.

η = N*Tt   /(Tp+N(Tt ))

η = 1/1+(a/N) ,a=Tp/Tt

  • In case of reliability delay is better but in case of efficiency early is better.
  • If nothing is given in exam, by default go for early token reinsertion

5) Aloha:

  • Any time ,any station could transmit the data.
  • There is no carrier sensing.
  • Collision could be possible.
  • There are ack in Aloha,no need of Collision detection.
  • When ever your data is lost in collision ,then we are going to re transmit the data packet.Retransmission will take place after some random amount of time , that time is called as back off time.

Aloha is of two type :

a)Pure Aloha: 

            Vulnuable time=2Tt , 

means before one Tt and after one Tt no one should transmit the data ,if some one is transmit the data we are going to get collision.

                 η = G *e-2G

                  η =18.4%

b)Slotted Aloha:

                   The main diff between pure aloha and slotted aloha is, in pure aloha any station can start transmitting data at any time But in slotted aloha time is divide in to slots and every station is forced in such a way that it should start transmitted at the beginning  of the slot,if it is missed out time slot it has to wait fornnext time slot.

             Vulnuable time=Tt

        η = G *e-G

   η =36.8%

Contributor's Info

Created:
0Comment
Design issues for the layers | Addressing | Direction of Transmission | Scalability | Routing | Reliability | Error Control | Flow Control | Multiplexing and De-multiplexing | Confidentiality and Integrity

The following are the design issues for the layers:
I) Addressing:

  • There are multiple processes running on one machine.
  • Every layer needs a mechanism to identify senders and receivers.
  • Since there are multiple possible destinations, some form of addressing is needed in order to specify a specific destination.

II) Direction of Transmission:
Based on system communication, system are classified as:

  • Simplex Systems.
  • Half Duplex Systems.
  • Full Duplex Systems.

III) Scalability:

  • When network gets large, new problem arises.
  • Thus scalability is important so that network can continue to work well when it gets large.

IV) Routing:

  • When there are multiple paths between source and destination, only one route must be chosen.
  • This decision is made on the basis of several routing algorithms, which chooses optimized route to the destination.

V) Reliability:

  • It is a design issue of making a network that operates correctly even when it is made up of unreliable components.

VI) Error Control:

  • It is an important issue because physical communication circuits are not perfect.
  • Many error detecting and error correcting codes are available.
  • Both sending and receiving ends must agree to use any one code.

VII) Flow Control:

  • If there is a fast sender at one end sending data to a slow receiver, then there must be flow control mechanism to control the loss of data by slow receivers.
  • There are several mechanisms used for flow control such as increasing buffer size at receivers, slow down the fast sender, and so on.
  • Some process will not be in position to accept arbitrarily long messages.
  • This property leads to mechanisms for disassembling, transmitting and the reassembling messages.

VIII) Multiplexing and De-multiplexing:

  • If the data has to be transmitted on transmission media separately, it is inconvenient or expensive to setup separate connection for each pair of communicating processes.
  • So, multiplexing is needed in the physical layer at sender end and de-multiplexing is need at the receiver end.

IX) Confidentiality and Integrity:

  • Network security is the most important factor.
  • Mechanisms that provide confidentiality defend against threats like eavesdropping.
  • Mechanisms for integrity prevent faulty changes to messages.

Contributor's Info

Created:
0Comment
Need for layered designing for networking and communication

Need for layered designing :
1. The first computer networks were designed with the hardware as the main concern and the software as an afterthought.
2. This strategy no longer works.
3. Network software is now highly structured.
4. To reduce their design complexity, most networks are organized as a stack of layers or levels, each one built upon the one below it.
5. The number of layers, the name of each layer, the contents of each layer, and the function of each layer differ from network to network.
6. The purpose of each layer is to offer certain services to the higher layers while hiding those layers from the details of how the offered services are actually implemented.
7. In a sense, each layer is a kind of virtual machine, offering certain services to the layer above it.
8. Therefore Layered Architecture provides Flexibility to modify and develop network services.
9. Let us consider the example: Given below is a three-layer network. When layer n on one machine carries on a conversation with layer n on another machine, the rules and conventions used in this conversation are collectively known as the layer n protocol.

Contributor's Info

Created:
0Comment
192.168.1.1 Private Router Login IP

192.168.1.1

The IP '192.168.1.1' is one of the most popular IP known to internet users. It is given to network devices as there default IP's by manufacturers of network printer, wireless routers and to many more such network devices.

If you have purchased any new network device and you don't know how to access its management console panel, then just connect that device with your computer and open web browser and type '192.168.1.1' and hit enter. It will than prompt for username and password, by default most manufacturers set both values as 'admin'. Once you pass this phase you are displayed with web page which has all details about your network device settings. This is a very simplified method to configure your network device.

 

'192.168.1.1' belongs to branch of private IP addresses. These private IP addresses unlike public addresses need only to remain unique inside a local network. They are used again and again worldwide in networks of schools, corporate offices, banks and many more. Its only due to these private IPs IPv4 is still surviving.

 

So coming back to our topic which is an IP address 192.168.1.1 of Class C. I show you step by step process of how to access my new wireless router 'kasda' model KW5815U2.

 

First of all switch on your wireless router. Once its powered on open your web browser and type 192.168.1.1 and hit enter. Do not confuse this IP address with 192.168.l.l because 192.168.l.l or 192.168. ll is not a valid IP address .

Once you press enter key after typing 192.168.1.1 in your web browser, you will see following screen

Username by default is admin, most of devices come along with password set as admin. I type 'admin' as user name and 'admin' as password .

Once you press enter you will see following screen

This is the management console of your wireless router and lets you configure your wireless router settings.

Next we see what's the impact of this IP on your computer. To see this open 'Network connection details'.  

Above is details of my wireless network connection on my PC. My PC has adopted 192.168.1.1 as its default gateway, DHCP and DNS server, as you can see in red box

 

Contributor's Info

Created: Edited:
1Comment
Sumit Verma @sumitverma 24 Apr 2017 03:59 pm

Nice !!

Cache Mapping Techniques

By caching data, operating systems want to minimize delay to fetch next data or instruction. Cache mechanisms use principle of locality to bring in data which may be accessed next, based on currently accessed data, for faster access. There are two locality principles:
Temporal locality:  data which is used recently may be used again in near future.
Spatial locality:  data near to current accessed data may be accessed in near future.
There are three mapping techniques : Direct mapping, fully associative and set associative mapping.
Direct mapping:
In a direct mapped cache, lower order line address bits are used to access the directory. Since multiple line addresses map into the same location in the cache directory, the upper line address bits (tag bits) must be compared with the directory address to ensure a hit. If a comparison is not valid, the result is a cache miss, or simply a miss. The address given to the cache by the processor actually is subdivided into several pieces, each of which has a different role in accessing data.

Fully associative:
In fully associative mapping, when a request is made to the cahce, the requested address is compared in a directory against all entries in the directory. If the requested address is found (a directory hit), the corresponding location in the cache is fetched and returned to the processor; otherwise, a miss occurs. 

Set associative mapping:
The set associative cache operates in a fashion somewhat similar to the direct-mapped cache. Bits from the line address are used to address a cache directory. However, now there are multiple choices: two, four, or more complete line addresses may be present in the directory. Each of these line addresses corresponds to a location in a sub-cache. The collection of these sub-caches forms the total cache array. In a set associative cache, as in the direct-maped cache, all of these sub-arrays can be accessed simultaneously, together with the cache directory. If any of the entries in the cache directory match the reference address, and there is a hit, the particular sub-cache array is selected and outgated back to the processor. 

Contributor's Info

Created:
0Comment