Chapter 2: The OSI Model and TCP/IP Model
Practice Questions and Lab Exercises
Come on, practice time! Draw the diagram by hand and do the labs on the terminal – only then will the layers stay in your memory for good.
चला, आता प्रॅक्टिस! डायग्राम हाताने काढा आणि लॅब्स टर्मिनलवर करा – लेयर्स तेव्हाच कायमचे लक्षात राहतील.
चलो, अब प्रैक्टिस! डायग्राम हाथ से बनाओ और लैब्स टर्मिनल पर करो – लेयर्स तभी हमेशा के लिए याद रहेंगे.
- Name the 7 OSI layers with one protocol and one device for each.
- What is the PDU at the transport, network and data link layers?
- Compare a TCP byte stream with UDP datagrams. Explain why classic DNS can use either transport and why ordinary SSH uses TCP.
- Draw the OSI vs TCP/IP mapping diagram and write four differences.
- Describe an Ethernet switch’s forwarding, an IP router’s decision, an ALB HTTP rule and the packet fields a security group may evaluate. Name the layer responsibilities each decision uses.
- Explain a fresh visit to the fictional
https://portal.training.example/classes. Then explain how a cached answer or HTTP/3 can change the visible stages. - Lab: Follow the controlled localhost HTTPS exercise. Identify the configured address, TCP connection, peer validation and HTTP result.
- Lab: Compare the supplied DNS observations and inspect a local route decision. State which address information and forwarding decision each result establishes.
Quick Revision
- OSI 7 layers: Physical (bits), Data Link (frames, MAC, switch), Network (packets, IP, router), Transport (segments, TCP/UDP, ports), Session, Presentation (representation and encoding), Application (HTTP, DNS, SSH).
- TCP/IP 4 layers: Network Access, Internet, Transport, Application.
- Encapsulation adds headers going down; decapsulation removes them going up.
- TCP exposes an ordered byte stream with acknowledgement and retransmission. UDP exposes connectionless datagrams. Performance depends on the application and path.
- Fresh TCP-based HTTPS visit: use address information when needed, establish the protected exchange, request the resource and process the result. Caches, reuse and HTTP/3 can change the observed stages.
Got it? Once you learn to think in layers, troubleshooting becomes half as hard. Now let's move on to Linux – the real language of cloud servers.
समजलं का? लेयर्सप्रमाणे विचार करायला शिकलात की ट्रबलशूटिंग अर्धं सोपं होतं. आता पुढे जाऊया Linux कडे – क्लाउड सर्व्हरची खरी भाषा.
समझ आया? लेयर्स के हिसाब से सोचना सीख लिया तो ट्रबलशूटिंग आधा आसान हो जाता है. अब आगे चलते हैं Linux की तरफ़ – क्लाउड सर्वर की असली भाषा.
Prepare one observation record for all the exercises
This workbook practices the difference between naming a layer, measuring an exchange and explaining what a result proves. Begin on paper. Sketch two endpoints with a local link and an optional router in between. Then use the small local fixtures to compare what a program receives when a connection path works, a name is unexpected or an application resource is absent. Keep the diagrams and actual observed results separate so you can tell whether you measured the same thing you drew.
Use a Linux or macOS command-line shell with Python 3 and curl for the local labs. An instructor-provided Linux environment works on Windows if the commands run inside that same environment. None of the lab listeners should be available beyond your own machine. Bind server examples to loopback, choose ports that do not disturb existing processes and avoid using real accounts or private data. The AWS exercise near the end uses false addresses and a supplied evidence fixture. It does not require creating a VPC or paid resources.
Set up an observation sheet with the test name, client context, intended resource, expected result, actual result and one unsolved question. If you see a status code, also record a harmless response marker or a specific next comparison. If an error happens before HTTP, record the furthest stage the client explicitly reports. An instructor can use your sheet to confirm that you changed one condition at a time. Correcting a predicted result is allowed and useful. Claiming the network is fully healthy after one test is too broad for this workbook.
If you are new to the vocabulary, read why the model exists and the seven layers before trying to name them from memory. Refer to the website visit walkthrough for a local TLS lab. Repeat this workbook with a class partner by asking them to predict each result but allowing them to explain a valid alternative. Real systems include configurations that can change details even while the principle remains useful.
Exercise one maps a packet and its frame on paper
Use the following fictional network. A learner workstation has address 10.55.1.20/24. A printer is at 10.55.1.80. The local router is 10.55.1.1. A training web service is represented by the documentation address 192.0.2.55. Make a route sketch with one local prefix and a default route through the local router. The workstation has a separate link identifier from the router and the printer. Give each label a simple name rather than inventing actual equipment details.
Predict the on-link case
Consider one IP packet from the workstation to the printer. The destination matches the workstation’s local subnet prefix. Under the supplied drawing, it can attempt local delivery to the peer. Its first data-link frame needs a destination appropriate to that printer's local presence. The learned link value can come from a cache or, for a typical Ethernet IPv4 situation, an ARP exchange. The remote service address is irrelevant to this first request. Draw a data-flow arrow between the two local endpoints and label the IP destination and link destination separately.
Predict the routed case
Now draw the workstation connecting to the fictional web address. That destination does not fall inside its local prefix. The example default route selects the gateway, so the first link delivery goes to the gateway’s local interface. The IP packet still identifies the web service as its network destination, and the appropriate transport header contains a destination port under the selected example. In an ordinary TCP-based HTTPS drawing you can use 443. A later router can construct a new frame on another link. It does not use the original workstation’s work of identifying the first local neighbour as an instruction for all later links.
Compare the result and explain a wrong answer
Make two rows. For the printer, expect the local printer's link label and its IP as the packet destination. For the remote service, expect the local router's link label and the fictional service address in the IP header. If your drawing uses the remote service's link label on the first frame, revisit which device shares the host’s attached network. If it replaces the remote IP destination with the router's local IP, revisit what the router needs to continue forwarding. Address translation, if present, would be a separate configuration to label. It is not part of the basic example.
Take the same drawing and map it to the two models. For the first link, note the physical carriage and data-link delivery in OSI and combine those responsibilities in the TCP/IP link layer. For the packet's routing, write network and internet respectively. The TCP port belongs to transport in both views. The purpose of the eventual web request belongs near the application layer. Explain how the diagram still represents the same request after you relabel it. There is no network resource to clean up. Recycle the worksheet by asking a partner to check the two destination values without reading your labels.
Exercise two uses one port number with two transport protocols
A common quiz answer says that a port belongs to a specific web or database program. A safer answer names the transport protocol, local address and actual configuration. This lab shows that the same number can be used on separate transport protocols. It also demonstrates the difference between a TCP stream and delivery of a datagram. Use Python 3 locally. The program chooses a port for its TCP listener, tries the same numeric port with UDP and closes both at the end. It does not need a login or any remote target.
python3 - <<'PY'
import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as tcp_listener:
tcp_listener.settimeout(2)
tcp_listener.bind(("127.0.0.1", 0))
tcp_listener.listen(1)
endpoint = tcp_listener.getsockname()
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as udp_listener:
udp_listener.settimeout(2)
udp_listener.bind(endpoint)
with socket.create_connection(endpoint, timeout=2) as client:
connection, _ = tcp_listener.accept()
with connection as peer:
peer.settimeout(2)
client.sendall(b"one ")
client.sendall(b"stream")
client.shutdown(socket.SHUT_WR)
pieces = list(iter(lambda: peer.recv(4), b""))
print("TCP port:", endpoint[1])
print("TCP combined:", b"".join(pieces).decode("ascii"))
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sender:
for message in (b"one", b"datagram"):
sender.sendto(message, endpoint)
pieces = [udp_listener.recvfrom(64)[0] for _ in range(2)]
print("UDP port:", endpoint[1])
print("UDP messages:", sorted(piece.decode("ascii") for piece in pieces))
PY
Expect the same printed port number for TCP and UDP in this successful run. The exact number depends on the operating system. Expect the TCP read to assemble “one stream.” Expect the UDP list to contain both “datagram” and “one” as separate entries. We sort the display so that the exercise does not rely on delivery order. Each socket has its own transport protocol. Opening one does not mean there is a corresponding service on the other. A successful loopback test says nothing about a public TCP or UDP path.
Before running the example again, explain why TCP can carry two writes and return a different collection of reads. The receiver chose to ask for no more than four bytes at a time. Its final result follows the order of the stream. The UDP receiver asks for a separate datagram and receives one message at each successful call. This does not guarantee that a future UDP message will arrive or arrive first. If either listener cannot bind because the operating system chose a number already occupied in the other protocol, rerun this disposable fixture so it can choose a different number.
If the script raises a timeout, read which stage failed. A failed TCP accept or receive is different from a failed UDP receive. Check the exact environment, loopback support and whether the script was copied completely. The TCP shutdown in the sample marks the end of the sender's stream, allowing the simple receiver loop to finish when no more bytes are available. Omitting it can make the receiver wait for another read. Each socket is automatically closed by the example.
To prove you understood the lab, write the expectation for one optional change. If you remove the send of the second UDP message while leaving two receives, the latter can time out. TCP reliability does not imply a second UDP message appears, even when the numeric ports match. If you split the TCP writes differently while preserving the bytes and final shutdown, the combined text should stay the same. These tests illustrate two distinct transport responsibilities without bringing an Internet route into the picture.
Exercise three compares response headers and response bodies
Use two local terminals and create a small folder for one HTTP fixture. In this exercise you will use GET to obtain a document with an identifying marker, HEAD to see only the regular metadata, and GET with a missing resource to see an error. Use this known local server because its simple file behavior is easy to predict. Another application can make its own specific decision about method and path. You will write results for this fixture instead of assuming every endpoint behaves the same way.
In terminal A create the temporary folder and one HTML document. It carries a title and an unambiguous marker you can identify inside the response. Serve only that folder and bind to loopback. If port 8094 is already used, choose a free local port and change every command that needs it. After starting, check which address and port appear in the process output before trusting your observations. This step creates a local web service; it does not change any cloud route or register a domain name.
HTTP_LAB_DIR=$(mktemp -d)
printf '%s\n' '<!doctype html><title>Protocol lab</title><p>Workbook fixture C</p>' \
> "$HTTP_LAB_DIR/current.html"
python3 -m http.server 8094 --bind 127.0.0.1 --directory "$HTTP_LAB_DIR"
In terminal B make the first request with the normal method. The response display should include a success status and the expected marker. Then run HEAD against the same resource with -I. With this simple Python server, expect a success status and response fields but no HTML body. Compare the request method lines reported by the local server. Annotate the two responses with their purposes. HEAD can test representation metadata, while the actual marker in the GET shows the practice document content reached the client.
curl --noproxy '*' --connect-timeout 3 -sS -i http://127.0.0.1:8094/current.html
curl --noproxy '*' --connect-timeout 3 -sS -I http://127.0.0.1:8094/current.html
Now obtain just the headers of a GET. The command below uses -D - to print received headers and sends the body to the system's null device. That output can look similar to HEAD, but the listener log should report GET. If an application only supports GET at a specific route, this is one way to keep the actual request method while showing just headers. Use it carefully because discarding the body removes your ability to verify the revision marker in that invocation.
curl --noproxy '*' --connect-timeout 3 -sS -D - -o /dev/null \
http://127.0.0.1:8094/current.html
Try one absent filename with a GET and note that there is an HTTP result even though the operation did not find its target. In this simple command curl can still return a successful program exit after receiving an HTTP 404 because it completed the transfer. That does not make the application status 200. Decide whether your test needs a tool error, an application status using its appropriate options, or a content check. Record these distinct meanings. A script can make a poor production check if it treats every successful command exit as a successful business result.
curl --noproxy '*' --connect-timeout 3 -sS -i http://127.0.0.1:8094/absent.html
printf 'curl exit status: %s\n' "$?"
If the request has no status and curl prints a connection error, check whether the lab server is still running and that both terminals use the same environment. If the marker differs, check the actual address and folder before proceeding. After the experiments stop Python with Ctrl+C in terminal A. Verify the directory path and remove the created file and its empty parent. No later part of the workbook depends on this server. Keep the recorded method, response and marker conclusions.
printf '%s\n' "$HTTP_LAB_DIR"
rm -- "$HTTP_LAB_DIR/current.html"
rmdir -- "$HTTP_LAB_DIR"
Exercise four separates DNS answers from the service selected by a client
Use these sample observations without querying the invented name. An instructor's portal name has a new IPv4 value at its authoritative service. The campus recursive resolver returns that new value for the training host. Another resolver still returns the previous value which it cached earlier under the original lifetime. A third observation shows that a client from a separate network chooses an IPv6 address instead of either IPv4 value. All three records refer to the same written service name. Their differences are important when you decide which connection to test.
| Observation point | Record or selected result | Fictional data |
|---|---|---|
| Authoritative practice zone | Current A record | 192.0.2.90 |
| Campus recursive resolver | A answer used by the working student | 192.0.2.90 |
| Other practice recursive resolver | Previously cached A record | 192.0.2.61 |
| Third learner's browser | Selected IPv6 destination | 2001:db8::90 |
Write a prediction for each client. Does the current A record alone identify where the outside client connected? Does the old answer prove that the official record never changed? Can you classify the IPv6 client's reachability by testing only the IPv4 address? State which evidence is missing. A browser can use a cached connection or resolver result, so the packet destination it actually used is useful information. A test from a different tool may query another resolver or choose another address family. The exercise uses example addresses that should not be treated as an active service.
Review the expected assessment
The authoritative response describes the current record at that source. The outside resolver can show older information while its cache is eligible. The third student used a different address family, so a separate permitted check to that address family is needed to describe its reachability. Compare the exact resolver, observed method, chosen address and test time. Make an approved service request only when you have a legitimate lab target for it.
Now plan a controlled address override if you need to distinguish name resolution from a later web problem. In a user-owned lab, preserve the named origin and ordinary peer verification while specifying the known target for just one command. This lets you ask whether the service answers the expected hostname at that address. It leaves the question of ordinary resolver behavior unresolved. A second test using the intended normal resolver answers that part. These tests should not involve changing the global DNS configuration or trust settings of shared machines.
For an executable version with a controlled HTTP fixture, choose the host-aware local exercise on the common mistakes page. Predict its response when the request map chooses the same local address but supplies a different host name. You should see that application behavior can change even when transport succeeds. If you use the correct name but skip its required mapping, you no longer have a controlled path to the localhost fixture. Use its provided cleanup to stop the process when finished.
Exercise five compares TLS trust, identity and HTTP routing
This exercise uses the disposable self-signed case in the local HTTPS walkthrough lab. Follow the prerequisites there for your Python, OpenSSL and curl environment. There is no live certificate change or paid service. Its only private key belongs to the local temporary fixture, and you should not reuse it. The address override keeps the example name and connection under your control. The peer checks remain enabled throughout the exercise.
Plan a grid with columns for expected target name, trust material selection, requested path, transport result and HTTP result. Before running the walkthrough, fill four rows. Match the sample name with the explicit trusted certificate and request the file. Keep trust fixed but select the wrong name. Keep the correct name but take out the fixture's trust option. Finally restore both and request a missing file. The cases are deliberately similar so you can isolate the missing requirement. Record only the safe displayed status and diagnostic lines. There are no credentials to print in this example.
The matching named request should succeed and show the lab marker. The wrong name should be rejected when the client verifies service identity. In a default training setup with no trusted copy of the temporary certificate, omitting the extra trust should also fail a check. The missing file should get 404 because name and trust allow the exchange to reach the application. Both certificate errors happen before an ordinary HTTP result, while the last error has a visible HTTP status. Compare logs on the responder to see which commands reached HTTP handling.
If the first case fails, do not continue assuming you have the intended fixture. Verify the selected address and port, certificate file path, generated name and local time. Check that OpenSSL created the expected files and the Python process bound to loopback only. If the normal trust case succeeds unexpectedly, investigate whether that exact temporary certificate was already loaded in the client context. The goal is to see normal verification, not to obtain a response by disabling it. Stop the listener and clean up the temporary key, certificate and content exactly as the walkthrough describes.
Exercise six marks each leg of a private backend design
Use paper or the optional local validation below. These are fictional addresses and configurations. The exercise does not ask you to build cloud resources, alter routes or widen policy. Draw a browser that uses HTTPS to a public-facing load balancer. Draw an independent connection from the load balancer to a private backend that uses HTTP on port 8080. The load balancer chooses the target because the browser asks for the practice schedule path. Use the packet values in the table to reason about each leg.
| Connection and direction | Source values | Destination values |
|---|---|---|
| Browser request | Approved client, TCP 52001 | Public listener, TCP 443 |
| Browser response | Public listener, TCP 443 | Approved client, TCP 52001 |
| Backend request | Load balancer private side, TCP 51003 | Private service, TCP 8080 |
| Backend response | Private service, TCP 8080 | Load balancer private side, TCP 51003 |
Begin the picture with an authorised public client and a frontend certificate for the course name. Put the certificate check on the browser connection, before HTTP can be read on that leg. Put the selected path and target group choice at the frontend. Put a separate backend listener at port 8080. A successful browser peer check therefore describes the frontend and cannot prove the backend uses encryption. If a new design requires HTTPS between the frontend and backend, draw which endpoints participate in the second peer exchange and verify its settings on that leg too.
Assume the practice backend's approved inbound security group rule permits its service port from the load balancer's authorised configuration. Its stateless subnet ACL accepts the request with destination 8080. Now a flawed ACL change permits eligible outbound traffic only when its destination port is 8080. Which table row for the backend no longer works in the simplified paper model? Write the direction and the exact reply destination as the reason. A student who checks only the server's listening port in both directions will miss why the response is blocked by that fictional rule.
Compare the expected packet outcome
The backend reply has destination port 51003, the source port of the frontend side of that leg. The stated outbound rule would not allow it. A security group's tracking does not bypass an independently applied ACL. The browser's temporary port 52001 belongs to the different client leg and should not be copied into the private leg's return analysis.
The next program checks only the port-side logic of these supplied cases. Real rules can also use address ranges, rule order, protocol and other context, and route paths need their own verification. The program does not connect to AWS or simulate all ACL behavior. It takes the test's assumed ingress and egress destination port rules and labels the two directions. Read both test cases and predict the lines before executing.
python3 - <<'PY'
request_destination = 8080
reply_destination = 51003
for label, return_ports in (
("incorrect fixture", range(8080, 8081)),
("corrected fixture", range(51000, 51100)),
):
incoming = request_destination == 8080
outgoing = reply_destination in return_ports
print(f"{label}: request passes={incoming}, reply passes={outgoing}")
PY
Expect a true request result for both cases and reply false in the incorrect fixture. The second permits the toy reply because the sample destination falls inside its supplied range. Do not use that range as a recommendation for real clients; appropriate ephemeral-port constraints and policy depend on actual endpoints and configuration. The value of the exercise is that changing only the modeled return rule changes only the example return result. If you obtained true both times, read which endpoint value the reply is supposed to match.
Draw a deliberately denied direct request from an unrelated internet client to the private backend. The application's browser entry path can be healthy while this direct test is impossible by design. Keep the intended private boundary in your checklist. A solution that restores public access by exposing the backend broadly does not fit the exercise. To finish, give one meaningful later verification for the approved front path and one for the private target leg. No cloud resources were created and the Python printout needs no cleanup.
Exercise seven repairs an outage report in stages
Start from this message, “Cannot open the site from home.” Ask your practice partner which service is intended, which exact safe URL was attempted, whether home access is approved, and what error appeared. Ask for the original test time. A good reply is specific without requesting session tokens, passwords or internal information you do not need. Keep the intended client consistent during each new comparison. This exercise uses the reported observation as data rather than treating the wording as diagnosis.
First record shows a transport timeout
The approved home client receives the name result for the service and then times out on the defined port. The office test succeeds at the same time. List the facts that separate this from name failure. Now draw the two paths and mark which differs in route, source network or policy. If the service is actually private, the home connection might be outside its intended path. If both are authorised, compare routing, network filtering and the listener evidence before asking the application team to redeploy code.
Write the expected next outcome for your chosen read-only comparison. For example, inspect whether the documented frontend permits the approved client source and whether its listener is available on the specified port. If the configuration differs between sources, verify the same intended request after an approved targeted correction. A timeout does not identify a particular device on its own. An HTTP server log can also be empty because the attempt never reached that layer. Put the missing observation next to the request value it would test.
Second record shows a named TLS rejection
Rewrite the case so transport now succeeds, but the client rejects the certificate for the intended address. Name the first newly successful stage and the first failed stage. Compare the expected host with the peer's identity data, validation time and trust behavior. If a DNS change leads to a different service address, that could explain a different certificate. If it stays at the same service, check the listener and certificate selection. Do not use a disabled verification check as the success criterion in a secure web test.
The next check should preserve the intended name and validation. In an authorised fixture, try the named request to the intended address and read where validation ends. If it fails before HTTP, do not claim a missing page was returned. If the correct name works after the approved change, run the relevant route and content check. A clean peer check opens the opportunity to request a resource. It does not establish that the resource exists or matches the current revision.
Third record shows an application response
Change the evidence again. The home client passes peer verification and receives 404 from a front component, while an approved origin test returns the expected page. Describe two useful comparisons: the exact request host and path used at the frontend and the selected target and outcome there. A proxy can generate its own 404 if a rule or configured service does not match. An origin can produce the same status for a different path. The number by itself cannot tell you which component answered. If you have permission, correlate timestamps or a harmless request marker.
Prepare a short conclusion with evidence and limits. For instance, “Our approved front request connected and got an HTTP result. We still need to verify the matched host and route because a separate origin request succeeded.” Distinguish the first success from the remaining question. Use the test steps above to show how independent checks can narrow a developer's work. No infrastructure or external tests are needed for this paper exercise. Keep an example response table and discard any temporary scratch data when finished.
Exercise nine writes a retest someone else can perform
Review a fictional fix request. A teammate claims the timetable is repaired because their curl process exits successfully after it reaches the frontend. You find that the visible status is 404. Rewrite the acceptance check so it specifies the authorised source, exact scheme and host, method, route and expected response marker. Include an explicit distinction between a completed transfer and the application's intended status. If your partner uses the wrong resource, the retest should reveal it.
Add a negative test without changing the network. Choose a clearly absent training resource or a method the exercise is known to disallow. Predict the expected error and repeat the original successful request afterwards. If the denied path starts returning a benign-looking default success page, do not silently mark it correct. Confirm whether an incorrect route or fallback handled it. This two-case retest teaches why a known success and a meaningful negative result support a stronger conclusion than one status number.
Finish by proposing a different check for a repaired connection failure. The same client and intended host should now connect under the approved network rules. It should still verify peer identity and receive the expected resource. Describe what should remain denied under the intended access design, such as a direct public path to a private backend. Keep the scope bounded to the lab. You have not created any resources in this exercise. Save the two result rows as your evidence and remove any fictional values you copied into a shared support ticket.
Exercise eight reads local interface, route and listener evidence
This optional extension needs a Linux training machine with the iproute2 tools. It reads operating system state and makes no configuration changes. The example destination belongs to a documentation address range. The route query asks which route the kernel would use; it does not open a connection to the address. If your regular machine uses another operating system, use the previous loopback labs or compare results from the instructor instead of trying commands meant for an unrelated environment.
ip -brief addr
ip route get 192.0.2.55
ss -ltn
Use the first result to find the system's visible interfaces, their states and associated network addresses. Do not assume the device is called eth0. Names vary across systems and virtual environments. A normal interface output can show both IPv4 and IPv6 values, and a loopback interface has a different purpose from a network-facing interface. Write the interface you used when observing the intended local request. If you need to submit a screenshot, redact unrelated addresses and machine names according to your training instructions.
The route output can include the next hop marked by via, the interface after dev and a selected source after src. It can also report that the isolated lab has no route for the address. Either result is useful. If the route lookup used an eligible default gateway, that describes the kernel's configured forwarding choice under the test. It does not prove later delivery or an application listener. An unreachable message for this documentation address may be expected in a restricted classroom environment.
Read the third result as a list of local TCP listeners. Compare it with the temporary HTTP fixture in exercise three. If you want a second observation, start that fixture again and compare the binding before and after it runs. A localhost entry should show the chosen port only for the intended local interface. Stop only the process you started and apply the file cleanup from that exercise. Combine the socket list with one local GET rather than treating socket metadata as proof that a specific resource worked.
Write a three-part explanation. A visible interface and assigned address describe local attachment and configuration. The route answer describes a possible next step for a destination. The listener list describes processes accepting connections from appropriate addresses. Those observations are related but none replaces the application result. If your test ran inside a virtual machine or container, identify that environment first. No route table, server package or cloud account needs to be changed for this exercise.
Review the answers using the result that supports each claim
A local test returned 200 for GET and 405 for HEAD. Did the application host become unreachable?
Both results require an HTTP responder. The method changed, and the route can require a particular method. Read the Allow field if it is provided and test the method the actual application uses. A connection failure before HTTP is a different result. Exercise three's simple Python server supports HEAD, while the method-aware fixture on the common mistakes page does not. The two fixtures demonstrate different valid application choices.
Does a port number identify the same endpoint for TCP and UDP?
The numeric value alone does not do so. Exercise two binds TCP and UDP with the same number on the same local address, and each protocol receives its own data. A valid transport test needs the protocol and appropriate message behavior as well as an address and port. The fact that a local TCP service accepted a connection does not show that UDP can exchange data with a real service.
Why can an IPv4 gateway's link address appear in traffic aimed at another network?
The local link delivers the frame to the next hop that can forward the packet. The network destination in the packet still names the remote endpoint under the simple model. The router can create a different frame for the next link. Exercise one separates the local delivery question from internet forwarding. This prevents the mistake of replacing every destination field with a router address just because the router is the first hop.
What is the first useful difference between a certificate error and a 404 in the TLS fixture?
The certificate error happened before the expected HTTP handler response. The HTTPS client connected far enough to check the peer and could not verify it under the selected conditions. The 404 came from a responder after the intended security checks succeeded. Write which configuration changed between the tests. The right next investigation could be a certificate identity check or a missing application resource, depending on that evidence.
Why does a scoped IPv4 test not prove what the browser reached?
The browser might choose IPv6, use a route through a proxy, reuse a connection or receive different cached DNS data. The test proves only its own method, endpoint and protocol path. Start from the actual browser observation and compare a controlled client check that matches it. A useful handoff names both observation points and asks how their paths differ.
Short quiz
Place the ordinary TCP SYN in the visit diagram. Does it travel before there is any IP route, travel inside a packet carried over the selected path, or travel after the HTTP response?
Check your answer
It is part of the connection attempt and is carried by IP across the selected route. Link delivery and forwarding are already needed to get it to the peer. An HTTP response would come later on the fresh successful TCP exchange.
The public client’s source port is 52001 and the load balancer’s private source port is 51003. Which value is the destination port for the backend reply in exercise six?
Check your answer
51003. The backend reply goes to the peer that initiated that transport leg. The client and backend connections have their own values and can be inspected separately.
Which result confirms the practice timetable revision: only a successful curl process exit, an HTTP 200 from an unidentified server, or the correct named request with the expected status and body marker?
Check your answer
The correct request with the expected marker. A status or tool exit alone can be accurate without confirming the intended server, path and version. Keep these other results as supporting evidence.
Revision cards
Draw packet and frame
Label the end network destination and the next local link destination separately. Each value has its own readers and lifetime.
Observe the method
GET and HEAD can produce different application behavior. A response header display is not evidence that the request used a particular method until you check it.
Verification stays on
When using a test address for a known name, keep normal certificate identity and trust checks. Compare the name, security result and HTTP response.
Clean evidence
Use approved local or classroom resources, record the exact outcome, and stop the processes or remove the sample files when the experiment ends.
Primary references
- ITU X.200 OSI model, RFC 1122 Internet host communication layers, RFC 826 address resolution and RFC 5737 documentation addresses
- RFC 9293 TCP, RFC 768 UDP and Python socket API
- RFC 1034 DNS, RFC 9525 TLS service identity, RFC 9110 HTTP semantics and RFC 3849 IPv6 documentation prefix
- AWS security groups, Network ACLs and ALB listener rules
- Python HTTP server, curl options, ip-route manual and ss manual