Back to the topic

The mark scheme starts on a new page, so you can print pages one and two for a student and keep the last page yourself. Everything prints in black on white whichever theme you are using.

Python · A Level 20

Networks and the Web in Python

Section A: 10 multiple choice questions, 10 marks. Section B: 5 written questions, 22 marks. Total 32 marks.

Name

Class

Date

Mark  / 32

Section A

Circle the letter of the correct answer. One mark each.

  1. 1What is encapsulation in the TCP/IP model?1
    1. AEach layer adds its own header to the data as it goes down the stack
    2. BCompressing data before sending it
    3. CJoining two networks together
    4. DEncrypting data so it cannot be read
  2. 2Why does each packet have a sequence number?1
    1. ATo encrypt the packet
    2. BTo show how important the packet is
    3. CTo tell routers which network to use
    4. DPackets can arrive out of order, so the receiver can put them back
  3. 3What does a router use to decide where to send a packet?1
    1. AThe sequence number
    2. BThe destination IP address
    3. CThe packet's checksum
    4. DThe source MAC address
  4. 4The address 192.168.5.130 has a subnet mask of 255.255.255.192. What is its network address?1
    1. A192.168.5.130
    2. B192.168.5.192
    3. C192.168.5.128
    4. D192.168.5.0
  5. 5How many usable host addresses are there in a /24 network?1
    1. A24
    2. B254
    3. C255
    4. D256
  6. 6What does DNS do?1
    1. AAssigns IP addresses to devices
    2. BEncrypts web traffic
    3. CBlocks unwanted traffic
    4. DTranslates a domain name into an IP address
  7. 7Which of these makes TCP reliable?1
    1. ASending every packet twice
    2. BUsing a larger packet size
    3. CAcknowledgements and retransmission of lost packets
    4. DEncrypting every packet
  8. 8Why do online games usually use UDP rather than TCP?1
    1. AA late packet is useless, so speed matters more than guaranteed delivery
    2. BUDP guarantees the order of packets
    3. CUDP is more secure
    4. DTCP cannot carry game data
  9. 9A browser requests a page that does not exist. Which status code comes back?1
    1. A200
    2. B301
    3. C404
    4. D500
  10. 10Why should input be validated on the server as well as in the browser?1
    1. ABrowsers cannot validate text
    2. BServers can validate faster
    3. CIt is required by HTTP
    4. DClient-side checks can be bypassed by the user

Section B

Answer in the space provided. The number of marks tells you how many separate points to make.

  1. 1DescribeDescribe how a large file is sent across the internet using packet switching.4
  2. 2CalculateA computer has the IP address 192.168.5.130 and the subnet mask 255.255.255.192. Calculate the network address, and the number of usable host addresses on this subnet. Show your working.4
  3. 3ExplainExplain how the Transmission Control Protocol (TCP) makes sure that data is delivered reliably.4
  4. 4ExplainExplain the difference between client-side processing and server-side processing, giving an example of each.4
  5. 5DiscussA user types the address https://www.example.org/news into a web browser and presses enter. Discuss what happens, from the browser to the page appearing on the screen.6

Mark scheme

Section A

1A2D3B4C5B6D7C8A9C10D

Section B

1 Describe how a large file is sent across the internet using packet switching. 4

One mark for each of the following, to a maximum of 4.

  • The file is split into packets
  • Each packet has a header with the source and destination addresses and a sequence number
  • Routers pass each packet on separately, so packets can take different routes
  • At the destination the packets are put back in order using the sequence numbers, and missing ones are requested again

Model answer. The file is split into small packets. Each packet has a header containing the source and destination IP addresses and a sequence number. Routers pass each packet on separately, choosing the next step towards the destination, so the packets of the same file can take different routes and arrive in a different order. At the destination the packets are put back in the correct order using their sequence numbers, and any that are missing or damaged are requested again.

2 A computer has the IP address 192.168.5.130 and the subnet mask 255.255.255.192. Calculate the network address, and the number of usable host addresses on this subnet. Show your working. 4

One mark for each of the following, to a maximum of 4.

  • Writes the last byte in binary: 130 = 10000010 and 192 = 11000000
  • ANDs the address with the mask to give 10000000, which is 128, so the network address is 192.168.5.128
  • The mask has 6 zeros, so there are 6 host bits
  • 2^6 = 64 addresses, less the network and broadcast addresses gives 62 usable hosts

Model answer. In binary the last byte of the address is 130 = 10000010 and of the mask is 192 = 11000000. ANDing them gives 10000000, which is 128, so the network address is 192.168.5.128. The mask has 26 ones, which leaves 6 bits for the host part. That gives 2^6 = 64 addresses, and since the first (the network address) and the last (the broadcast address) cannot be used by devices there are 62 usable host addresses.

3 Explain how the Transmission Control Protocol (TCP) makes sure that data is delivered reliably. 4

One mark for each of the following, to a maximum of 4.

  • Each packet is given a sequence number so the receiver can put them in order and spot missing ones
  • The receiver sends an acknowledgement for the packets that arrive
  • If the sender does not receive an acknowledgement before a timeout, it resends the packet
  • A checksum is used to detect damaged packets, which are discarded and so resent

Model answer. TCP gives each packet a sequence number, so that the receiver can put them in the right order and tell if any are missing. The receiver sends an acknowledgement for the packets that arrive. If the sender does not receive an acknowledgement before a timeout, it assumes the packet was lost and sends it again. A checksum is used to detect packets that were damaged on the way, which are discarded and so are sent again.

4 Explain the difference between client-side processing and server-side processing, giving an example of each. 4

One mark for each of the following, to a maximum of 4.

  • Client-side processing is carried out on the user's device, usually by the browser
  • An example such as checking a form field as it is typed, or animating a menu
  • Server-side processing is carried out on the web server before the page is sent
  • An example such as checking a password, or searching a database

Model answer. Client-side processing is carried out on the user's own device, usually in the browser using JavaScript. An example is checking that a form field has been filled in while the user is typing, or animating a menu. Server-side processing is carried out on the web server, which then sends the result to the browser. An example is checking a user's password against the database when they log in, which must be done on the server because the user cannot be allowed to see or change the code.

5 A user types the address https://www.example.org/news into a web browser and presses enter. Discuss what happens, from the browser to the page appearing on the screen. 6

One mark for each of the following, to a maximum of 6.

  • The browser uses DNS to look up the IP address of www.example.org
  • It opens a connection to the web server using TCP, and HTTPS means the connection is encrypted
  • It sends an HTTP request using the GET method for the path /news
  • The server finds or builds the page, perhaps using a database, and sends an HTTP response with a status code such as 200 and the HTML
  • The browser renders the HTML and makes further requests for linked files such as CSS, images and scripts
  • The data travels as packets, which are routed separately and reassembled at each end

Model answer. The browser first asks a DNS server to translate the domain name www.example.org into an IP address. It then opens a TCP connection to the web server at that address, and because the address starts with https the connection is encrypted. The browser sends an HTTP request using the GET method for the path /news. The web server finds or builds the page, perhaps using a database, and sends back an HTTP response with a status code such as 200 OK and the HTML of the page. The browser renders the HTML and makes further requests for files that the page links to, such as style sheets, images and scripts. All of the data travels as packets, which are routed separately across the internet and reassembled in the correct order at the other end.