1. Concepts and Terms (i) & 2. TCP Sockets Flashcards
Where in the 5 layer model do sockets interface?/Where in the model is the sockets API?
Application - Transport
What does a socket address consist of?
IP Address or DNS name (32bit IPv4 128bit IPv6) & a port number (16bit).
e. g. minervamedia.cs.st-andrews.ac.uk 13
138. 251.214.10 13
Outline a Java TCP Daytime client
- open a socket connection to address and port
- input stream reader wrapped in a buffered reader on the socket
- read a line and print it
What is encapsulation?
The process of adding/removing headers to a message as it is sent down/up the network layers.
What is a protocol? How can a protocol be broken?
A set of rules for meaningful interaction between two or more parties. Consists or one or more rounds of messages and sets of possible states at each entity. Can be broken by:
- missing message
- unrecognisable message
- wrong timing
- wrong ordering
- wrong response
What kind of information can be in a message header?
- destination address
- type of message
- protocol version
- message indentifier
- type of contents
- size of contents
What aspects are orthogonal to layering abstractions?
- security
- the impact of Moore’s law
- mobility
- energy efficiency
What is the loopback address? What is it useful for?
127.0.0.1 / localhost
Useful for testing a network program.
What duplex is a TCP connection? Describe this duplex.
Full-duplex, meaning both parties can communicate simulationously, like a Skype call.
TCP is connection-oriented or connectionless? Describe this.
Connection-oriented, meaning a connection session is established before any meaningful data transfer happens.
How does TCP ensure a reliable transmission?
- retransmits missing packets
- flow control (stops sender overrunning the receiver)
- packets are numbered so they can be ordered correctly
- each packet’s reception is acknowledged, if the packet is not acknowledged within a time, it is resent
Describe the TCP 3-way handshake.
Connection:
- server listens on port n
- client connects to port n on server address
- server accepts connection and sends a confirmation
- client receives confirmation and sends acknowledgement
- server receives acknowledgement
~exhange of data~
Closing:
- server sends close notification
- client receives and acknowledges
- server receives acknowledge
- both close their local connection
What is the purpose of a buffer?
A location to store data while it is being moved from one place to another. It is more effecient to read from a buffer than process every byte as it arrives, and more efficient to write to a buffer, then send a full segment, than it is to send every byte as it arrives from the application.
Describe the application layer.
Where network applications and their application-layer protocols reside, such as HTTP. User interacts with the application which sends requests to the application layer on the other end.
Describe the transport layer.
The transport layer transports application layer messages between endpoints. TCP and UDP reside here. Transport layer passes a transport layer segment and a destination address to the network layer.