Sockets Flashcards
What is the purpose of the Java Networking Framework?
To enable java programs on different systems to interact with each other, and even call each others methods
through RMI.
Which internet layer are Java Programs on? Which layer are the transport protocols on?
Application Layer. Transport Layer.
Explain how TCP transmits data to another machine…
- Sets up an initial connection via a handshake with the recipient. Sender now has IP and Port number to sends to
and vice versa. - TCP can then send ordered packets along this connection, guaranteeing order and delivery.
- More computationally expensive than UDP.
Explain how UDP transmits datagrams to another machine…
- Route to a specific IP and Port number.
- Is done in one go with no order.
- Delivery is not guaranteed and some data may be missing.
- Less computationally expensive and is quicker.
What is the purpose of ports? How do they work?
Ports on a machine are assinged to applications. This means incoming data will has an IP and port number in order
to reach the relevant application on the destination machine.
Explain how servers use sockets for TCP communication?
The server sets up a socket on a port. This socket listens for incomming connection requests. When a connection
request is recieved, the machine accepts, and redirects the connection to the appropriate port. A new socket is
then place on the original port for listening, and the server continues listening for new requests.