levo

Networks

Protocol layering and the TCP/IP stack

  • 3 things to know
  • Component 01
Start revising · £5/month

Overview

Recall questions on protocol layering, the application, transport, internet and link layers of TCP/IP, what each layer adds, port numbers, IP and hardware addresses, TCP and UDP, encapsulation, and why layering eases maintenance.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What happens as data travels back up the stack on the receiving machine?

Key term

What is a port number and why does the transport layer need one?

Key term

Which protocols operate at each layer of the TCP/IP stack?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is protocol layering?

    Model answer

    Protocol layering is the design principle of splitting network communication into a stack of self-contained layers, each responsible for one job and each offering a defined service to the layer above it while using the service of the layer below. A layer only has to know how to talk to the equivalent layer on the other machine and how to hand data to its neighbours; it does not need to know how any other layer does its work. Data passes down the stack on the sending machine and up the stack on the receiving machine.

  2. 2

    Name the four layers of the TCP/IP stack in order from the top down, and give the job of each.

    Model answer

    Application layer: at the top. It provides the protocols that programs use to exchange meaningful data, such as HTTP, HTTPS, FTP, SMTP, POP3 and IMAP, and it produces the actual content to be sent. Transport layer: it establishes an end-to-end connection between the two applications, splits the data into segments or packets, numbers them so they can be put back in order, and (with TCP) manages acknowledgement and retransmission of anything lost. Network layer, also called the internet layer: it adds the source and destination IP addresses and is responsible for routing each packet across networks from source to destination. Link layer, also called the data link or network access layer: at the bottom. It handles transmission over the physical medium of the current hop, using hardware (MAC) addresses, and defines how bits become signals on cable, fibre or radio.

  3. 3

    As data passes down the TCP/IP stack, what is added at each layer?

    Model answer

    The application layer produces the data itself, formatted according to an application protocol such as an HTTP request. The transport layer breaks it into segments and adds a header containing the source and destination port numbers, a sequence number so the segments can be reassembled in order, and a checksum. The network layer adds a header containing the source IP address and the destination IP address, which is what routers use to forward the packet. The link layer wraps the whole thing in a frame with the hardware (MAC) address of this machine and of the next device on the path, plus an error-check field at the end. Each layer treats everything handed down to it as data and simply puts its own header in front: this is called encapsulation.

  4. 4

    What happens as data travels back up the stack on the receiving machine?

    Model answer

    The reverse: each layer strips off and acts on the header its counterpart added, then passes the remainder up. The link layer checks the frame's error-check field, confirms the frame was addressed to this machine's hardware address, and removes the frame header. The network layer checks the destination IP address is this machine and removes the IP header. The transport layer uses the sequence numbers to reassemble the segments in the right order, requests retransmission of anything missing or corrupt, and uses the destination port number to decide which application should receive the data. The application layer then interprets the data according to the application protocol, so the browser sees exactly the HTTP response the server sent.

  5. 5

    What is a port number and why does the transport layer need one?

    Model answer

    A port number is a 16-bit number identifying a particular application or service on a machine. An IP address gets a packet to the right computer, but a computer runs many programs at once, so something must decide whether an arriving packet belongs to the browser, the email client or the file transfer. The transport layer header carries a destination port number for exactly that purpose, and a source port number so the reply can be returned to the right program. Well-known services use agreed port numbers so a client knows where to connect without being told: for example HTTP on 80, HTTPS on 443, FTP on 20 and 21, SMTP on 25, POP3 on 110 and IMAP on 143.

  6. 6

    The IP addresses in a packet stay the same all the way across the internet, but the hardware addresses change at every device. Explain why.

    Model answer

    The IP addresses identify the two ends of the whole journey - the original sender and the final destination - so they must be preserved end to end or the packet could not be routed to its target or replied to. The hardware (MAC) addresses identify only the two ends of the current single hop across one physical network. When a router receives a frame, it strips the link-layer frame, consults its routing table using the unchanged destination IP address, and builds a completely new frame addressed to the next device along the chosen route. So the network-layer header survives the journey and the link-layer header is discarded and rebuilt at every hop.

Other ways to work this

The same content, four other ways.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

A global variable means a variable reachable from anywhere in the program.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Networks, on a schedule.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.