Donnerstag, 13. November 2014

TCP, UDP

First of all, let's have a look at this video:


In general a packet follows the 5 layer-structure.

L1: Physical Layer (Ethernet or coaxial cable)
L2: Datalink Layer (Ethernet or WIFI)
L3: Network Layer (IP)
L4: Transport Layer (TCP, UDP)
L5: Application Layer (e.g. HTTP)




Tcp&udp.jpg

UDP advantages:
  • smaller packet sizes
           UDP header: 8 bytes
           TCP header: 20 bytes
  • Connectionless (you don't have to create a connection for sending something)
  • More control, when data is sent
TCP:
  • Connection needed
  • It's used, where no data loss can be tolerated!

Questions & Answers:


  • What is the purpose of the transport layer?
It allows multiple applications to use the same internet-connection simultaneously.
One application can use multiple ports at the same time, if it wants.
For instance, an application reserves port4917 for sending an message to another machine. This message is passed on to the transport layer. The message is packed in a segment, which has the source (port4917) and the destination( port80) in it.
Then this is passed on to the network layer.
On the receiver site, the segment with the message passes from the network layer to the transport layer. There the segment will be unpacked, so the message can move to the destination port (port80).

  • How is the PDU (protocol data unit) called in the transport layer?
It's the TCP (Transmission Controll Protocol)

  • What has to be done before the PDU from the transport layer is passed to the network layer?
It has to be encapsulated.

  • Why can packets containing UDP be much smaller than that containing TCP?

  • What is the main charactersitic of a connection-oriented transmission?
The 3-way-handshake (TCP).

  • What happens at UDP and TCP when a segment gets corrupted?
TCP handles the retransmission.
At UDP lost packets are not retransmitted

  • What happens in UDP when an older segments arrives after a newer one?
There is no guarantee for ordering packets. They can come in another queue.

  • Explain the term "congestion control". What does it mean when a network is "congested"?
The congestion control delays the transmission, when the network is congested.
Congested: when the network is overloaded

  • What are the key characteristics of TCP?
There is a connection needed!
It offers retransmission, UDP not!
It's used for file transfers, remote access,...


  • Is the checksum mandatory in UDP?
The checksum in UDP is 16 bytes, but it's not reliable.
In UDP, the checksum is just mandatory in IPv6.

  • Which disadvantages does TCP show over UDP?
  1. Bigger Header
  2. Data doesn't always get send out immediately (cause: congestion control)
  3. Bigger overhead (Retransmission of packets, acknowledgement of packets
  • Which transport layer protocol is used in realtime communication applications (Skype, VoIP)?
UDP, also for video streaming, where an amount of package-loss can be ok.

  • What's the difference between a stream oriented and a message oriented protocol?
A message-oriented protocol is UDP:
The application sends data in distinct chunks
E-Mail

A stream-oriented protocol is TCP:
Used as a continuous flow of data
Split up in chunks by TCP
Phone conversation

  • When is it better to use TCP rather than UDP?
When you need a transmission, where no loss can be tolerated!

  • TCP 3-way-handshake
The transmitter asks the recipient, if he wants to setup a connection.
Then the recipient replies to this request of the transmitter.
When the transmitter receives the request-package, it sends an acknowledge to the recipient.

  • What is the TCP window size?
It's the maximal amount of data, which you can send or receive, without confirming data.

  • How many bits are used for sending the sequence number? Why does the sequence number start with a random number?
32 bit. 
  • By which number is the sequence number incremented when the sender is acknowledging the SYN(Synchronized Sequence Number) packet from the receiver?
SYN: This bit indicates, that the segment is being used to initialize a connection.

Keine Kommentare:

Kommentar veröffentlichen