Monday, March 8, 2010

Need of port number in networking

____________________________________________
If you're not familiar with MAC or IP addressing., were going to cover that in another section, but for now it's enough to know that when two hosts communicate on a network, they're using these MAC and IP addresses as the destination when the data is sent.


So far, so good. But what if one host is sending multiple flows of information to the remote host? Let's say that the PC at 10.1.1.1 is sending three different kinds of information to the PC at 10.1.1.2:

    -   transferring a file via Trivial File Transfer Protocol ( TFTP )
    -   email via Simple Mail Protocol ( SMTP )
    -   opening a remote connection via Telnet

If you're not familiar with those three protocols, don't worry about it - you will be before you're done with this course. For now, it's enough to know that one PC is sending three different types of information to the other, and the MAC and IP source and destination addresses for all three transmissions is going to be the same. How can the receiving host tell TFTP from SMTP if that's the case?

We need a way for the recipient to differentiate on data flow from the other, and since the source and destination MAC and IP addresses will be the same for all three flows, that won't do. What will do is the TCP or UDP port number, While these three data flows will have the same Layer 2 (MAC) and Layer 3(IP) source and destination addresses, they'll have different, pre-assigned port numbers.

Port Numbers Multiplexing :- Mixing of data to different ports when transmitted.
____________________________________________

TCP features vs. UDP features compared with headers

____________________________________________
All of the features - the three-way handshake, windowing, sequence numbering, error detection and recovery  are all TCP features. UDP doesn't use any of them. Two questions come to mind :

      -   Why doesn't UDP offer these features?
      -  Why in the world do we use UDP for anything?

A look at the TCP and UDP headers will answer both of those questions!!

The TCP header


UDP Header


The UDP can't perform any of those TCP features because USO literally can't offer them. The UDP header has no sequence number field, no ack number field, no ACK bit, no SYN bit, and no window field.

The TCP and UDP headers have only three values in common|:
   -   Source port
   -  Destination port
   -  Checksum

Now if UDP can not offer all these features, why do we use it in first place. That question can really be answered with one word .........."overhead".
The TCP header is much larger that the UDP header. That header is being applied to every segment, and that adds up!!! UDP's advantage over TCP is that its header is much smaller than TCP's.

___________________________________________

Sunday, March 7, 2010

Windowing technique

____________________________________________

Windowing refers to the amout of data that a data sender is allowed to transmit without waiting for an ack. In this case, the size of the window is 2400 bytes, meaning that the data seder can transmit 2400 bytes before it has to stop and wait for an ack,

The data recipient decides the size of the window, not the sender. This gives the recipient some control over how much data is sent ("flow control").



The term sliding window refers to this dynamic adjustment of the window size.
UDP does not have windowing capabilities.

____________________________________________