Computer Science • Networks and Protocols

Packet Routing

Normal day Route — Tables converged Tick 0

Click a link or a router to change it

Arrived
In order
Message

Packet

1×

What's happening

    R1's routing table

    Destination networkNext hopCost

    Packet Routing — Explanation

    A computer on Net A sends the message MEET YOU AT THE WHARF AT 9 to a computer on Net B, across a network of seven routers (R1 to R7). The message is split into seven numbered packets. Press Play, or Step one tick at a time, and follow them: the panel on the right says what each router does, shows the routing table it used, and the packet it handled.

    The key ideas

    Simplified: the costs are delays in ticks; routers here send their tables only when they change (real RIP also sends them every 30 seconds, and counts hops rather than adding costs; OSPF works out routes from a map of the whole network instead); each router can send one packet per tick down each link; and the network names and IP addresses are from the ranges kept for documentation or private use.

    Common exam mistakes

    "The router sends the packet along the whole route." Each router only chooses the next hop; the next router decides again, from its own table.
    "All the packets follow the same route." In packet switching each packet is routed separately. If a link fails or gets busy, later packets go another way, which is why they can arrive out of order.
    "Packets that arrive out of order are errors." They are normal. The sequence number lets the destination put them back in order.
    "The header holds the data." The header holds the addresses, the sequence number and the TTL; the data is the payload.
    "TTL is a time in seconds." In IP it is a count of hops: each router takes one off.

    Exam-style questions and answers

    1. Describe the structure of a data packet. [4]

    Answer. A header containing the destination address, the source (originator's) address and the packet (sequence) number; the payload, the actual data being sent; a trailer containing an error check (such as a checksum or CRC) and a way of identifying the end of the packet.

    2. Explain how packet switching sends a file across the internet. [5]

    Answer. The file is split into packets, each with a header. Each packet is sent separately; each router reads the destination address and sends the packet on to the next router along the best available route, so packets may take different routes. The packets can arrive in a different order; the receiving computer uses the sequence numbers to put them back in order. If a packet is missing, it is requested again.

    3. Explain why the packets of one message might arrive out of order. [2]

    Answer. Each packet is routed independently, so they may take different routes (for example after a link fails or becomes congested), and some routes take longer than others; a lost packet that is sent again arrives later still.

    4. State the purpose of the time to live (hop limit) in a packet's header. [2]

    Answer. Each router reduces it by one; when it reaches zero the packet is discarded. This stops packets that can't be delivered (for example caught in a routing loop) from circulating for ever and using up the network.

    5. Give one benefit and one drawback of packet switching compared with circuit switching. [2]

    Answer. Benefit: the links are shared and used efficiently, and packets can be re-routed round a failed or busy link. Drawback: packets can arrive out of order or be delayed, so they must be reassembled, and the delay varies (a problem for live video or voice).

    Objective: describe how data is broken into packets and transmitted using packet switching, the structure of a packet (header, payload, trailer) and the role of a router (Cambridge IGCSE Computer Science 0478, 2.1 Types and methods of data transmission); packet switching and circuit switching, and the role of routers (Cambridge AS & A Level Computer Science 9618, AS 2.1 Networks including the internet); and the TCP/IP protocols, with routing between networks and reassembly by TCP (9618 A Level 14.1 Protocols and 14.2 Circuit switching, packet switching).

    Where this fits

    • AP: AP Computer Science Principles
    • AQA: AQA A Level Computer Science (7517)
    • Cambridge: Cambridge IGCSE Computer Science (0478); Cambridge A Level Computer Science (9618); Cambridge AS Level Computer Science (9618); Cambridge A Level Information Technology (9626) Goes beyond Cambridge IGCSE Computer Science (0478): Routing tables and distance-vector updates go beyond 0478, which only says a router controls a packet's route. Goes beyond Cambridge A Level Computer Science (9618): Routing tables and distance-vector routing go beyond 9618, which asks for the router's role and packet switching. Goes beyond Cambridge AS Level Computer Science (9618): Routing tables and distance-vector routing go beyond 9618, which asks for the router's role and packet switching.
    • IB: IB Computer Science HL; IB Computer Science SL Goes beyond IB Computer Science SL: Static and dynamic routing (A2.3.4) is HL only.
    • NCEA Level 2 Digital Technologies: 91895 Use advanced techniques to develop a network; 91895 Use advanced techniques to develop a network
    • NCEA Level 3 Digital Technologies: 91905 Use complex techniques to develop a network; 91905 Use complex techniques to develop a network
    • Pearson Edexcel International: Edexcel International GCSE Computer Science (4CP0); Edexcel International A Level Information Technology Goes beyond Edexcel International GCSE Computer Science (4CP0): Routing tables, TTL and re-routing go beyond 4CP0, which only says data is sent in packets. Goes beyond Edexcel International A Level Information Technology: Routing tables and distance-vector updates go beyond IAL IT.
    • USDP: USDP Computer Science

    Packet Routing — Key Terms

    Key concepts in English, with te reo Māori, Chinese (Simplified) and Korean.

    EnglishTe reo Māori中文(简体)한국어What it means on this page
    Packetno attested term数据包 (shùjùbāo)패킷 (paeket)A small piece of the data sent across a network: a header (source and destination IP addresses, sequence number, time to live), the payload, and a trailer with an error check.
    Packet Headerno attested term包头 (bāotóu)패킷 헤더 (paeket hedeo)The start of a packet, holding the information needed to deliver it: the source and destination IP addresses, the sequence number and the time to live.
    Payloadno attested term有效载荷 (yǒuxiào zàihè)페이로드 (peirodeu)The part of a packet that carries the actual data being sent.
    Packet Trailerno attested term包尾 (bāowěi)패킷 트레일러 (paeket teureilleo)The end of a packet: an error check, such as a checksum or CRC, and a marker for the end of the packet.
    Checksumno attested term校验和 (jiàoyànhé)체크섬 (chekeuseom)A value calculated from a block of data and sent with it; the receiver calculates it again, and a different value shows the data was changed in transmission.
    Sequence Numberno attested term序列号 (xùlièhào)시퀀스 번호 (sikwonseu beonho)The number in a packet's header showing its place in the message, so the receiving computer can put the packets back in order and notice any that are missing.
    IP Addressno attested termIP地址 (IP dìzhǐ)IP 주소 (IP juso)An address given to a device by the network it joins, used to send data to it across networks; it changes if the device moves to another network.
    Time to Live (TTL)no attested term生存时间 (shēngcún shíjiān)생존 시간 (saengjon sigan)A count in a packet's header that each router reduces by one; a router that takes it to zero discards the packet, so packets can't circle a network for ever. Also called the hop limit.
    Routerno attested term路由器 (lùyóuqì)라우터 (rauteo)A device that joins networks and forwards packets between them: it reads each packet's destination IP address, finds the destination network in its routing table, and sends the packet to the next hop.
    Routing Tableno attested term路由表 (lùyóubiǎo)라우팅 테이블 (rauting teibeul)The table a router uses to forward packets: for each destination network, the next hop to send it to and the cost of the route.
    Next Hopno attested term下一跳 (xià yī tiào)다음 홉 (daeum hop)The next router (or the destination network itself) a router sends a packet to, as its routing table says.
    Distance-Vector Routingno attested term距离矢量路由 (jùlí shǐliàng lùyóu)거리 벡터 라우팅 (geori bekteo rauting)A way for routers to build their routing tables: each tells its neighbours its cost to every network, and chooses, for each network, the neighbour with the lowest link cost plus that neighbour's cost (as RIP does).
    Packet Switchingno attested term分组交换 (fēnzǔ jiāohuàn)패킷 교환 (paeket gyohwan)Sending data as packets that are each routed independently, possibly by different routes, and reassembled in order at the destination; the links are shared.
    Circuit Switchingno attested term电路交换 (diànlù jiāohuàn)회선 교환 (hoeseon gyohwan)Setting up a dedicated path between two devices before any data is sent; all the data follows that path in order, and it is reserved until it is released.
    TCP/IPno attested termTCP/IP协议 (TCP/IP xiéyì)TCP/IP 프로토콜 (TCP/IP peurotokol)The protocols the internet is built on: TCP splits data into numbered packets, checks they all arrive and puts them in order; IP addresses and routes each packet.

    On the te reo Māori column. Terms marked as gaps have no attested equivalent in the sources checked — Karaitiana Taiuru's Dictionary of Māori Computer and Social Media Terms, Paekupu, the Reserve Bank's te reo financial glossary, NZQA and Te Aka. No coinage is printed as though it were established; where a class needs one, commission it from Te Taura Whiri i te Reo Māori and credit the translator. Te reo Māori is not italicised and takes no plural "s".