transport layer Flashcards
goal of the transport layer
provide logical communication between application processes running on different hosts
what happens on sender side
breaks app messages into segments and passes to network layer
what happens on receiver side
reassembles segmnets into messages and passes to app layer
explain multiplexing at sender
handle data from multiple sockets and add transport header
explain what is meant by demultiplexing at receiver
use header to deliver received segments to correct socket
how does demultiplexing work?
- host receives IP datagram - each has src ip and dest ip address, each contains trans layer segments, each segment contains dest port no
- host uses IP address and port no to direct segment to appropriate socket
Explain how connectionless demultiplexing happens
- socket created at local port
- when host receives UDP segment: checks dest port, directs udp segment to socket with same port n #
- IP datagrams with same dest port # directed to same sockets
Explain how connection-orientated demux happens
TCP socket identified by-tuple: src ip & port, dest ip and & port
- receiver uses all 4 values to direct to correct socket
server hose may support many simultaneous TCP sockets
TCP allows full duplex data - what does this mean
Bi-directional data flow in same connection and MSS (max segment size)
what are sequence numbers
byte stream number of first byte in segments data
what are acknowledgements
seq# of next byte expected from other side - cumulative ack
will 2 way handshake always work?
variable delays retransmitted messages message loss message reordering cant see other side
how can a two-way handshake fail?
1.) retransmitted connection request is delayed, client disconnects because it ack for inital message, server receives retransmitted connection request - establishes another connection with the client (who is disconnected)
Explain a three-way hand shake
c - choose initializing seq number x - send tcp syn messahe to establish connection (synbit = 1, seq = x)
s - choose initializing seq # = y, send synAck to client
- synbit = 1, seq = y, ackBit = 1, Ack# = x+1
c - send ack for synack to server (may also contain data)
- Ackbit = 1, Ack# = y+1
Explain how closing a tcp connection happens
c - close client socket (can no longer send but can still receive) - FinBit = 1, seq = x
s - can still send data to client - Ack = 1, Ack# = x+1 - client waits for server to close
s - Finbit - 1 seq = y – can now no longer send data but can still receive
c - acknowledges server close - Ackbit = 1, ack# = y+1