AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Networks agree on rules

Week 22 · 3.2 Data transmission · 3 lessons
1

Rules and handshakes

Computing 9: Topic 3.2, pp. 273–283
GoalExplain what a protocol is, say what TCP and IP each do, and put the three messages of a handshake in order.
New words
protocol · a set of rules that devices follow so that they can communicateTCP/IP · a group of protocols: IP finds the right device by its address and TCP makes sure the packets arrive safelyhandshake · a short exchange of messages that sets up a connection before any data is sentacknowledgement (ACK) · a message that confirms that something has been received
Explanation

Two devices can only share data if they follow the same rules. A set of such rules is called a protocol, like two people agreeing to speak the same language. TCP/IP is a suite of protocols used on the internet: IP uses the IP address to send each packet to the right device, and TCP checks that all the packets arrive safely so that the file can be rebuilt. Before any data moves, the two devices make a handshake with three messages. First, the device that wants to send sends SYN (a synchronisation message). Second, the receiver answers with SYN/ACK, which confirms the request and says whether it is ready. Third, the first device sends ACK to confirm that it got that answer. Then the data can start if the receiver is ready.

StepMessageSent byWhat it tells the other device
1SYNthe device that wants to send‘I would like to send you data.’
2SYN/ACKthe device that receives‘I got your request, and I am ready (or not ready).’
3ACKthe device that wants to send‘I got your answer.’
Worked examples
StepFromToMessage
1198.51.100.7 (laptop)203.0.113.9 (server)SYN
2203.0.113.9 (server)198.51.100.7 (laptop)SYN/ACK
3198.51.100.7 (laptop)203.0.113.9 (server)ACK
A handshake with addresses. A laptop at 198.51.100.7 wants to send a file to a server at 203.0.113.9. Three short messages go back and forth before any of the file moves. Only after step 3 can the file start.
ProtocolIts jobThe question it answers
IPdelivers each packet to the device with the matching addressWhere does this packet go?
TCPmakes sure the packets arrive safelyDid everything arrive?
The two jobs. A 12-page report is sent to another computer. IP puts the receiver’s address on every packet so that the packets are delivered to the right device. TCP looks after the safe delivery, so that every packet arrives and the report can be put back together. The two protocols work as a pair.
tabletserverSYNSYN/ACK
A handshake with a busy receiver. A tablet sends SYN to a server. The server’s SYN/ACK says that it is not ready yet. The tablet’s ACK only confirms that it got this answer. The tablet holds back the data and waits until the server is ready.
Class activity

Card handshake (no computer). Two players are two devices. Player 1 holds a card marked SYN. Player 2 answers with a card marked SYN/ACK and shows a thumb up (ready) or a thumb down (not ready). Player 1 replies with a card marked ACK. Only after the three cards may Player 1 read out four numbered paper strips (the packets) from a short message, and Player 2 puts them in order. Play again with a thumb down: what must Player 1 do with the strips?

Practice
1
Fill in the three missing messages of this handshake.
StepFromToMessage
1192.0.2.40 (phone)203.0.113.21 (server)?
2203.0.113.21 (server)192.0.2.40 (phone)?
3192.0.2.40 (phone)203.0.113.21 (server)?
2
Put these four events in the correct order: (a) the server sends SYN/ACK; (b) the file is sent; (c) the phone sends SYN; (d) the phone sends ACK.
3
A learner writes: ‘TCP finds the right device by its address, and IP makes sure the packets arrive safely.’ Correct the sentence.
4
The server’s SYN/ACK says ‘not ready’. Does the phone start to send the file straight away? Explain.
StepFromToMessage
1phoneserverSYN
2serverphoneSYN/ACK: not ready
3phoneserverACK