Ravindra BagaleCourses & study guides मराठी Track your progress

AWS Cloud

Chapter 2: The OSI Model and TCP/IP Model

Come on, friends, first let's understand why we need a layered model. When something breaks in production, a good engineer does not panic – they check layer by layer. This chapter will give you exactly that way of thinking. When a dairy brand like Amul (sample data, for practice) calls to say "our website won't open", you will also search layer by layer. It's very simple – just stay with me.

In this chapter

  • Why we need a layered model
  • The seven OSI layers and PDUs
  • TCP vs UDP and encapsulation
  • OSI vs TCP/IP model
  • Where AWS services sit
  • What happens when you open a site

Concepts in this chapter

  1. 2.1Why do we need a reference model?
  2. 2.2The seven layers
  3. 2.3The TCP/IP model and comparison
  4. 2.4Walk-through: what happens when you open a website?

Review and practice

  1. ★Common Mistakes I See Students Make
  2. ★Interview Questions
  3. ★Practice Questions and Lab Exercises

Watch data acquire protocol information

Watch data acquire protocol informationHTTP messageApplication meaningTCP streamPorts and ordered bytesIP packetSource, destination, routingLocal link frameReach the next link peer
Read all steps
  1. HTTP message

    The browser creates a request with application meaning, such as a method and target path. This diagram follows a simplified plaintext HTTP-over-TCP example; HTTPS adds TLS protection.

  2. TCP stream

    TCP carries a byte stream between endpoints. It adds sequencing and acknowledgement mechanisms. One HTTP message is not guaranteed to correspond to exactly one TCP segment.

  3. IP packet

    IP carries transport data across networks using addresses. Routers select outgoing paths. Ordinary forwarding updates fields such as TTL; translation and tunnels can change more.

  4. Local link frame

    The link technology carries an IP packet across one link. At a routed hop, the old link frame is processed and a new frame can carry the packet onward. Layer names describe responsibilities, not seven separate machines.

Follow the request before naming the layer

Imagine you are helping a training centre prepare for registration day. The coordinator opens the course page on a phone and sees a connection error. A colleague in the office sees the welcome page. Both say they opened the same website. To decide what to check, first write down the evidence you have. Find the exact address each person entered, the network each device was using, when the problem happened, and the full error text. A report that one device reached a web page and another timed out already gives you two observations to compare.

A web application relies on several smaller jobs. The browser reads an address, finds a destination, establishes a way to exchange data, and sends a request. The network carries that exchange over a local link and more distant networks. The server reads the request and decides which result to return. If the browser can resolve a name and still cannot connect, investigating the name alone leaves the later jobs untested. If the browser receives an HTTP response, at least some responder handled the request. You can then ask whether it was the service you expected and whether it understood the route you asked for.

A reference model describes these responsibilities in groups. Each group is called a layer. People use a layer name to specify the job under discussion, such as forwarding a packet to another network or returning a result for an HTTP request. The model supplies a vocabulary for a team. It does not require that every server package or device have seven separately installed parts. We will use the model to describe what we observe, then explain what is still unknown.

The existing four lessons take a student through the individual steps. Start with the purpose of a reference model if the word layer is new. Use the seven-layer lesson for the responsibilities and examples at each level. The TCP/IP comparison describes how an internet host groups the same work. Finish with the website walkthrough when you can read each step without memorising a phrase.

Give each identifier a job

Start with the address https://enrol.training.example/courses. The scheme is https, which tells the browser the kind of application exchange it should use. The host is enrol.training.example, a name that points the client toward a service. The path /courses tells the web service which resource the client is requesting. These are sample values. The .example domain is reserved for illustrations, so the class will not rely on a live site behind this address.

Suppose the host name resolves to 192.0.2.40 in our written exercise. An IP address helps the Internet Protocol deliver a packet to the right network destination. A server can run several applications on one address. A transport port helps identify which local communication endpoint belongs to this exchange. HTTPS typically uses port 443 when the URL does not specify a port. A local lab can use an explicit port such as 8081. Some services share a port and make a second decision later by reading the host name or path.

A MAC address is one kind of link-layer identifier, familiar on Ethernet and Wi-Fi networks. In an Ethernet example, it identifies endpoints on the local link. If the destination IP is on another network, the first frame can carry the gateway’s link-layer address while the IP packet inside addresses the remote destination. A router can then put the IP packet into a different frame on its next link. A student who draws a remote server’s MAC address in every frame has combined the lives of two different pieces of information.

Draw four columns labelled application host and path, destination IP, destination transport port, and local link destination. Fill the first three columns for https://enrol.training.example/courses using the sample address. Leave the last column as “determine the next hop” until you know the route table. Then change the path to /fees. The requested application resource changed, but the browser may keep the same connection to the same service. Change the name to files.training.example instead. DNS, the TLS server identity and application routing may now produce different results, even when the names share an IP address.

Four identifiers in the first request from a client to a remote web service
Value in this exampleDecision it supportsWhere it is interpreted
enrol.training.example and /coursesSelect the named service and requested resourceBrowser, name resolver, TLS endpoint and web application as appropriate
192.0.2.40Route a packet toward the serviceIP hosts and routing devices
TCP destination port 443 in the browser's TCP pathDeliver the exchange to the intended transport listenerTransport endpoints and path controls
Link address of the first next hopDeliver this frame on the current linkLocal link neighbours

When you document a test, write the address and port together where possible. “I checked the server” can mean a network probe to an IP, a TCP connection to port 443, or a web request to a particular route. Each result has value and each establishes something different. If the next engineer knows your exact test values, they can reproduce the result without changing the target by accident.

Seven layers and the evidence they help organise

The Open Systems Interconnection reference model has seven layers. The numbers run from the physical layer at the bottom to the application layer at the top. For a beginner, the useful starting point is one question each layer helps you ask. After you can explain the purpose, you can attach the exact name and number to it. Keep in mind that real internet protocols often combine jobs that OSI describes as separate responsibilities.

Layer 1 carries a signal

The physical layer describes how bits are represented across a medium. A cable can carry electrical signals, fibre can carry light, and a wireless device can use radio. The operating system may show that a physical interface lacks a link or that a laptop left its Wi-Fi network. Check the local device or approved dashboard for those clues. If a machine cannot attach to the local medium, its application still has a web address to open, but it has no usable path through that interface at that moment.

Imagine the office computer with the working welcome page uses a wired connection. The failing phone is on Wi-Fi. Seeing the Wi-Fi symbol tells you about that phone’s own connection state. It does not prove that the phone has a route to the web service or that the phone picked the intended wireless network. Record the network name and compare another approved device using the same link before restarting a cloud server. In AWS you usually see virtual networking interfaces and metrics instead of inspecting physical cables.

Layer 2 carries frames over one local link

The data-link layer describes how neighbouring systems exchange frames on the same link. Ethernet has link addresses and a frame format. An Ethernet switch can learn which of its ports sees a source link address and use that information to forward later frames toward a destination. A managed switch can provide more features, including routing on suitable models. In this lesson, use switching to name the frame forwarding job you actually observed.

Continue with a laptop sending IPv4 traffic to a remote network. Once its route selects a gateway, the host needs enough link information to contact that gateway. On a familiar Ethernet link, it can use ARP, the Address Resolution Protocol, to learn the link address associated with a local IPv4 next hop. IPv6 uses its Neighbor Discovery procedures for related jobs. If the host has a route but cannot reach the next hop on the link, a web-server log at the remote end is unlikely to see that attempt.

Layer 3 moves packets across networks

The network layer deals with addressing and forwarding between networks. IP packets carry source and destination addresses. A route is a rule used to pick where to send traffic for a destination. An IP prefix describes a range of related addresses. A host or router usually chooses the most specific matching route, so an entry for a smaller matching range can take precedence over a general default route.

For example, consider a client at 10.12.1.34 with a local network of 10.12.1.0/24. Another local address such as 10.12.1.52 falls in that range. The illustrative service address 192.0.2.40 does not. The host can hand remote-bound traffic to its default gateway if there is no more specific matching route. You can inspect the chosen route in a controlled Linux lab with ip route get. That command shows the host’s route decision. It does not send an HTTP request or prove that all later devices forward the packet.

Layer 4 provides transport between endpoints

The transport layer carries data between communication endpoints. TCP, the Transmission Control Protocol, creates a connection and gives the applications an ordered stream of bytes. It uses sequence information, acknowledgements and retransmission so that an application can read bytes in order even when individual network packets were lost or arrived in a different order. The endpoints each need memory to keep track of that connection. They may also close it before the application performs its intended operation.

UDP, the User Datagram Protocol, provides a way to send messages called datagrams, using ports and a small header. UDP itself does not establish a connection or reconstruct a lost run of messages. The application or another protocol can add stronger delivery properties. This is why an interviewer who asks you to compare TCP and UDP expects you to discuss what the transport supplies and what the program must arrange on top. It is possible to build a reliable application that uses UDP as part of its stack.

Layers 5 and 6 describe the conversation and representation

The OSI session layer describes organising communication between peers. Think of the work required to start a dialogue, keep track of useful context and end it. The presentation layer describes how communicated information is represented so that programs can interpret it. Character encoding, structured formats and transformations can matter here. A file of JSON delivered successfully can still be unreadable to a program that expected a different encoding or document shape.

These responsibilities are useful in troubleshooting even when modern implementations do not identify a separate session or presentation module. A browser can use cookies to continue an application session. A TLS library can protect the byte exchange and negotiate properties for the application. An application can parse JSON itself. You can describe the precise job you mean in each situation. Avoid treating every use of the word session as the OSI session layer or expecting every encryption operation to occupy one universal layer in all designs.

Layer 7 describes the application protocol

The application layer defines exchanges that applications use for a particular service. HTTP describes requests, response status codes and related fields. The DNS protocol provides ways to query and manage name information. DNS can operate over different transports. Naming it as an application protocol explains which job its messages do, rather than how an individual DNS request was carried across the network.

Return to the registration example. The browser asks the web service for /courses. The server could return a success response, redirect the client to another path, or answer that the resource cannot be found. A successful web response gives you evidence about the request path as observed by the responder. It tells you far more about the application than a reachability check alone. You still need to verify which responder issued it, especially when a proxy or cache stands between the user and the backend application.

Map the OSI questions onto the Internet protocol suite

The TCP/IP model groups related responsibilities into a smaller number of layers. The common four-layer view uses application, transport, internet and link. Internet standards discuss these categories as practical parts of protocols and host requirements. Some teaching materials use five groups by splitting off the physical layer. You can read either description by asking which adjacent jobs have been grouped together. The actual browser exchanges and forwarding decisions remain the same.

In a four-layer mapping the TCP/IP application layer handles the work represented broadly by OSI application, presentation and session. The transport layer provides endpoint communication, including TCP and UDP. The internet layer handles IP addressing and routing. The link layer supports delivery on attached networks. The mapping is approximate because the standards were designed for different purposes. It is a helpful way to compare responsibilities and a poor reason to assign a fixed OSI number to every cloud feature.

Suppose two engineers discuss TLS. One is explaining the encoding and protection of exchanged information. The other is taking a capture and locating TLS records carried over a TCP connection. Both can describe their observation clearly, and the placement language may differ between their references. The important agreement is which connection endpoint performs negotiation and which application exchange it protects. In HTTP/3, QUIC integrates security establishment using TLS 1.3, and uses UDP to send the transport packets. That example shows why a precise description of the protocol path is more useful than forcing every case into one rigid mapping.

Use one classroom drawing to check your understanding. Draw an outer box for Ethernet or Wi-Fi, a next box for IP, another for TCP and the inside for a typical HTTPS exchange over TCP. Move that same drawing into the four-layer view. The first two link jobs fit together at the bottom, IP remains internet, TCP remains transport, and the web request and its representation stay near the top. If you use HTTP/3 instead, change the transport description to QUIC over UDP and explain its security path. The browser still sends a request with an HTTP method and path.

Trace a fresh HTTPS request

Return to the training centre page. For this walkthrough assume there is no reusable connection, the browser uses HTTPS over TCP, and the name has an IPv4 address in the example below. Those assumptions keep one path visible at a time. Real browsers can reuse connections, find several address records, or negotiate HTTP/3. Each variation has a reason and can change the order of events you observe.

Find an address for the name

The browser needs a way to turn the host part of the URL into a destination. It can reuse information held by the application, operating system or a recursive DNS resolver. A recursive resolver can answer from its cache or look up the necessary information on behalf of the client. In our example it returns the illustrative address 192.0.2.40. The answer may have a time to live, or TTL, describing how long certain DNS data can be cached according to the protocol. TTL explains why different resolvers can briefly retain different answers after a record changes.

Write down “the client saw this DNS answer” rather than “DNS is fixed everywhere.” A service can have several valid addresses. An older cached answer is possible. A proxy can resolve a name itself instead of following the local host’s usual path. Start with the name and resolver the failing client actually uses, and compare it with the working condition before changing records. If you are working with a classroom-only domain, keep the values synthetic in your notes.

Choose a route and deliver the first packet

For the written example, the client has IP address 10.12.1.34 and sends from a temporary TCP source port, such as 51842. The connection destination is 192.0.2.40 on port 443. The IP routing decision picks the first next hop. The transport destination is still port 443 when that first packet is constructed. A local Ethernet frame can have the gateway’s destination link address while the IP packet inside it aims for the web service.

A router reads the IP destination and forwards according to its own route. When it forwards onto another link, the next frame has the link information necessary there. The destination IP normally remains meaningful over the IP path, although deliberate devices or services such as network address translators can change addresses or ports under their configured rules. Avoid setting up an internet resource for the example. The addresses are enough to reason about an ordinary forwarding path and one deliberate translation.

Establish the TCP connection

TCP establishes connection state at both ends. The initiating client sends a SYN, the server normally replies with SYN-ACK if it accepts, and the client acknowledges. A SYN marks an attempt to synchronise connection state, and ACK acknowledges information received from the other side. This exchange lets peers begin an ordered byte stream. It does not produce the training centre page by itself. A server that accepts connections can still fail before reading the first application request.

In a controlled capture or verbose local test, distinguish an attempt with no useful reply from an explicit refusal. A timeout can occur when packets or replies cannot get through, or when a device never responds. A refusal often indicates a rejection such as a reset from a host or intermediary. Save the destination, port, protocol and time before assigning a cause. The useful next check might be a listener on the approved backend, a path rule, or the return route. The same error string can have different causes in different topologies.

Verify the HTTPS peer and protection

In a typical HTTPS session over TCP, the client and server next perform a TLS handshake. TLS supplies protection for the later traffic and lets the browser check the service identity using certificate validation. A certificate contains public identity information that the client checks against the intended host name and a trusted chain under the client’s validation rules. The browser can successfully complete TCP and still reject a certificate. That gives you a more precise stopping point than “the network seems down.”

Web servers often serve several names from one network address. During suitable TLS handshakes, the client can indicate the requested server name so the server can select related configuration. When doing a controlled IP override to isolate a DNS issue, preserve the application host name and normal certificate checks. Asking a browser to visit the raw IP can change both how it checks the certificate and which site is selected. Those are separate changes from changing only the route to the original named service.

Read the HTTP request and response

With the protected exchange established, the browser sends an HTTP request such as a GET for /courses. A method says what the request is asking the service to do. The host or authority identifies the intended service, and the path identifies the resource within that service. The returned status describes how the server handled the request. A success response can contain the registration page, while an application response reporting that the path does not exist points toward the named resource or which backend received it.

A status code can be issued by a web server, proxy, cache, load balancer or backend. For instance, an intermediary with a failed backend connection can still return a gateway error to the browser over a working front connection. Match a harmless request marker or timestamp with approved access logs if you need to locate which component responded. The address you entered and the status you saw give you a start. The logs can tell you whether the backend ever saw the request.

Some pages then request stylesheets, images or browser code in separate requests. One successful initial page has not yet established that those files reached the browser. A useful first observation is the specific resource URL and its result in the browser’s network view. If the text appears but a stylesheet returns a missing-resource response, diagnose the asset path or deployment rather than treating the whole connection as bad. A page can work for one person using cached assets and fail for another who needs to fetch them again.

Understand encapsulation without drawing fictional packet boundaries

Encapsulation means one protocol carries information belonging to another. In the fresh HTTPS exchange over TCP, the application prepares useful data. TLS protects data in records. TCP carries bytes in a stream and sends portions of it in segments. IP packets carry the transport data between networks. A link then carries packets in frames suitable for that link. Each protocol can include control information in a header, and some links also use a trailer. A protocol data unit is the name a model uses for the information exchanged at a particular layer.

A classroom drawing often puts one box neatly inside the next. That is helpful for seeing responsibility, but students should avoid assuming every HTTP request fits in one TCP segment or that one TLS record always equals one packet. TCP presents a sequence of bytes to the application. It can segment or retransmit data according to conditions. A receiving program may need more than one read before it can parse the complete application message. Boundaries are governed by the protocol that defines them.

Draw a small paper trace with a request, then a protected exchange, then several transport segments. Give each segment an ordering role and mark one as delayed. In a normal successful TCP exchange, the receiving application still gets the byte stream in order as data arrives and is recovered. The delay may increase page loading time. On another sheet, write three independent application messages sent as UDP datagrams. If the middle datagram does not arrive, UDP does not create or request a replacement. Some applications tolerate the gap, and others add their own recovery behavior.

At the receiving endpoint the layers interpret the headers and deliver the relevant data upward. You do not normally read an entire browser request in a raw IP record if TLS protected that exchange. You can still use metadata such as addresses, ports and timing to test a hypothesis. Obtain application-level evidence from the approved endpoint or its logs. Learn to state the limit of each tool because a missing string in an encrypted capture says little about whether the application processed it.

Place AWS features on the right part of the path

A route table in an AWS VPC supports network decisions for traffic going to particular prefixes. An Amazon EC2 network interface can be associated with security groups that control permitted traffic. A security group is stateful, so eligible response traffic for an allowed flow is tracked. A subnet network access control list has separate inbound and outbound evaluation and is stateless. The two can both matter for a path. Start with the resource’s actual subnet and network interface rather than expecting a rule on an unrelated resource to affect it.

Walk an allowed client request through an example. A client sends from a temporary source port to an HTTPS listener at destination 443. The reply uses its own source and destination values in the reverse direction. If you are reading a stateless subnet rule, examine the relevant return path for the client-side destination port as well as the server’s listening port in the request direction. Keep permitted sources as narrow as the exercise allows. A narrow lab result has value that a wide-open rule would hide.

An Application Load Balancer can evaluate HTTP properties such as the host name and path when routing requests. This supports a course application with one group of servers for the registration route and another for general information. Check the listener, rule, selected target group and backend status for one request. A passing target health check describes the configured probe. It can pass even when a different path you need returns an application error.

A Network Load Balancer uses listeners configured for transport-related forwarding, with the exact protocols and optional TLS behavior described in AWS documentation. Learn the actual listener configuration rather than relying on a memorised product label. If a TLS listener ends one client-side TLS connection and the backend uses its own protocol and connection, draw both legs. Verify the frontend and backend independently. The fact that one leg negotiated encryption tells you about that leg’s configuration.

A load balancer or proxy can separate a request into a client-facing exchange and an origin-facing exchange. A browser may observe a valid certificate and a useful HTTP response on the front while the backend is unhealthy. Record the protocol and expected success for each leg. A VPC flow log provides network flow information for supported traffic types. It helps you reason about addresses, ports and acceptance or rejection recorded at its observation point. It cannot replace an application log when the question is which HTTP path the client requested or how the app handled it.

Lab on the laptop with a closed, open and missing route

In this lab you will change one condition at a time and compare what the client observes. You need a Linux or macOS shell, Python 3 with the built-in HTTP server module, curl and two terminal tabs on the same machine. Windows learners can follow from an available Linux lab environment and keep both tabs inside the same environment. These commands need no administrative privileges and no AWS account. The program binds only to 127.0.0.1, the IPv4 loopback address. A loopback request reaches the same host and lets you study transport and application outcomes without a router or a cloud firewall in the path.

In terminal A, create a fresh directory and write one harmless text file. The first command saves the path of a newly created temporary directory. The second places only the practice response inside it. Keep the path in this terminal because you will use it during precise cleanup. Python should serve this directory alone. If a program already uses port 8081, pick another unused port on your own machine and update every test. Leave unrelated programs running as they were.

LAB_DIR=$(mktemp -d)
printf 'Course page from the OSI practice server\n' > "$LAB_DIR/courses.txt"
python3 -m http.server 8081 --bind 127.0.0.1 --directory "$LAB_DIR"

The Python process should remain in the foreground and report that it is serving the loopback address and the chosen port. There may be platform differences in spacing and formatting. If Python says the address is already in use, the server never became your lab listener. Stop this setup attempt there and choose a different port. If the process exits with an unrecognised argument, check the Python version and use a supported training environment. Never change the bind address to a public interface just to work around a local setup problem.

In terminal B, make a normal HTTP request to the named file. The -i option displays headers along with the body, while -sS cuts progress noise and keeps errors. The connection timeout bounds the test if the connection cannot be made. The proxy option tells curl to make this localhost request directly even if your environment normally uses a proxy to reach websites. Save the first status line and the body text as your evidence.

curl --noproxy '*' --connect-timeout 3 -sS -i http://127.0.0.1:8081/courses.txt

Expect a status line containing 200 and the text “Course page from the OSI practice server” in the response body. Terminal A should log a request for the specified path. This proves a local TCP exchange occurred and the intended lab server produced an HTTP response for the resource. It says nothing about traffic from the internet because the listener is on loopback. Change only the requested path, keeping the same address, port and scheme.

curl --noproxy '*' --connect-timeout 3 -sS -i http://127.0.0.1:8081/no-such-course.txt

This time expect an HTTP status of 404. The address and port still worked. The response comes from the application’s HTTP handling of a missing file. The practice server will normally log that request as well. A beginner might see error text in the response and restart the computer. Your earlier success and this status together tell you to inspect the path before touching anything lower in this local setup.

Now press Ctrl+C in terminal A to stop only the lab server you launched. Repeat the successful-path curl command in terminal B. On a free loopback port the failure should occur before an HTTP status appears. Observe the connection failure text. Compare this with the 404 response. When a listener responds with 404, the client receives a complete HTTP result with status and headers. When it cannot connect, it has no new HTTP result from that server. If the old URL still responds, inspect whether your foreground process actually stopped or another approved program started using that port.

To clean up, return to the original terminal with the temporary directory variable. Verify the path is the one created for the lab, remove just the sample file and remove the now-empty directory. A nonempty directory is a cue to inspect it. This example never requires recursive removal. Keep your observation notes and omit unrelated information from them. Next time you see a browser error, try to identify the first missing observation in this sequence.

printf '%s\n' "$LAB_DIR"
rm -- "$LAB_DIR/courses.txt"
rmdir -- "$LAB_DIR"

Diagnose with a request record

Draw one row per result and place each at the stage where you obtained it. An unsupported assumption is easy to identify when it sits next to the actual observation. In the remote service example, suppose the office user looks up the correct name at 09:00 and opens the course page, while the remote user gets an address but the connection times out at 09:01. Both users obtained a name answer. Their source networks, resolved addresses, routes and firewall contexts can still differ. Ask one neutral question at a time, such as whether the two users received the same address.

Observed resultWhat you knowUseful next comparison
Name lookup returned a resultThe selected resolver provided address information for this request.Check whether the address is expected and whether the client can use the intended port.
TCP connected, TLS identity check failedThe transport endpoint answered and the HTTPS client rejected its peer or validation path.Compare the requested host, certificate names, validity period and trust chain.
HTTP 404 with expected local responderThe responder handled the request and reported no matching resource.Check method, path, site routing and whether the expected file or handler was deployed.
Gateway error with a healthy frontendA proxy or load balancer can answer while a later hop has trouble.Inspect backend connection and target logs using the same request time or marker.
Ping unanswered but HTTPS worksThe TCP and application path worked in that test. The ICMP probe got no observed reply.Inspect the approved ICMP policy only if you need that separate probe.

Do not assume that a denied or missing observation requires a policy change. A calm diagnosis can include reading the current listener, repeating a harmless test from an approved source, or checking a timestamp against events. If the existing configuration meets the intended design, a negative test may be correct. For instance, a web listener can succeed while a database endpoint remains deliberately unavailable to clients. A good finding names the approved path and the measured outcome.

When testers compare a direct IP probe and a named HTTPS request, keep their purposes visible. The direct probe helps locate a route or listener. A browser’s protected connection has additional identity and application requirements. If you need to substitute a known address in a controlled curl test, use a user-owned lab and preserve the intended host and normal TLS validation. Test one variable at a time so an improved response can be explained.

Explain a result in your own words

Which destination does an Ethernet frame use when the IP destination is outside the local subnet?

Assume the client chooses a gateway for that IP destination. The Ethernet frame for the first link needs the gateway’s local link address. The IP packet inside still identifies the remote destination. At the gateway, the old frame is removed and forwarding can use a new frame appropriate for the next link. The link and internet layers solve decisions at different distances.

A browser reports a certificate name error after opening the intended URL. What has already worked?

The client reached a TLS-capable endpoint far enough to receive identity information for the exchange. Start with the exact name the browser used and the certificate the responder supplied. DNS could have led it to a different server, a proxy could present its own certificate, or the intended endpoint could have the wrong certificate configured. Continue normal certificate validation while you identify the cause.

Why is a transport handshake different from an application success?

Transport establishes the ability to exchange data. An application still needs to parse the request, apply its access and routing decisions and produce the intended data. The local exercise demonstrates this by returning both 200 and 404 over working HTTP connections. An interview answer can name a concrete resource and point to a response or application log rather than simply saying the port is open.

How can HTTP/3 provide reliable streams when UDP does not?

QUIC defines additional transport behavior over UDP and supplies reliable streams to HTTP/3. UDP carries the QUIC packets without imposing TCP’s stream model. Describe the protocol providing the guarantee. Saying that UDP cannot carry a reliable application is too broad, while saying that UDP itself retransmits missing data attributes the work to the wrong component.

Quick quiz with answer explanations

Your client receives an HTTP 404 from the intended local server. Which change should you consider first: inspect the file path, replace the transport protocol, or edit a VPC security group?

Check your answer

Inspect the file path. The response proves that this server handled the request at the HTTP layer. The lab runs on loopback with no VPC routing. Check whether the filename and URL path correspond to the file the Python server actually serves.

The DNS answer for a practice site changes after an update. One resolver still returns the previous answer. Is it more useful to compare cached answer age and resolver configuration, or assume the new HTTP route failed?

Check your answer

Compare the name answers and cache conditions first. The observed difference arises before the new HTTP request reaches a particular address. A resolver can retain eligible cached information until expiry. After confirming the answer, test the exact named service and its port separately.

A one-hop local frame carries an IP packet for a different subnet. Does the frame need the remote server’s link address or the address of the selected next hop?

Check your answer

Use the selected next hop’s address on that local link. The remote destination is identified in the IP packet. A later router or endpoint handles its own link information. This is why changes in link headers can coexist with a coherent end-to-end IP path.

Revision cards

Model

Group responsibilities by the question each part answers. Use evidence from the same request. Associate the OSI name with the job only after you can explain the observation.

Address and port

IP helps locate a network destination. A port helps reach the intended transport endpoint. The host and path select the named application service and resource.

Layered evidence

A name answer, a working transport connection and an HTTP response describe different points in the path. Record them independently before changing any configuration.

Cloud boundary

Read the actual route, interface, listener and backend. A load balancer can create two exchanges. A response on one leg does not describe the behavior of the other.

Primary references

Practice Tasks

Practice checks run in your browser. They check the answer for this exercise; they do not create resources or connect to your AWS account.

About this scenario

Sangli Turmeric Traders is a spice trading business in Sangli. Dattatray Chavan looks after its IT and cloud work. They count money in INR and run their AWS resources in the ap-south-1 Region. In the tasks below you do real jobs for them using what this lesson teaches. All names, account IDs, IP addresses and numbers are made up for practice.

0 / 12

Easy How many addresses in a /16?

Picking a VPC size needs this count.

Sangli Turmeric Traders plans the VPC 10.204.0.0/16. How many IP addresses does it hold in total?

  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Easy Create a VPC

A VPC is your own private network in AWS. Everything else lives inside it.

Create a VPC with the CIDR block 10.6.0.0/16.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Easy Test a website from the server

curl shows whether the web server answers, even before DNS is ready.

Request http://localhost and show only the response headers.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium First usable IP for a server

The first 4 addresses are reserved by AWS.

What is the first IP address a server can get in 10.204.20.0/24 on AWS?

  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Medium Find the VPC router address

AWS reserves base+1 for the router.

Which address does AWS reserve for the VPC router in subnet 10.204.4.0/24?

  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Medium Usable IPs in an AWS /24 subnet

AWS keeps 5 addresses in every subnet.

How many addresses can Sangli Turmeric Traders use for servers in subnet 10.204.1.0/24 on AWS?

  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Medium Usable IPs in a /28

/28 is the smallest AWS subnet.

Subnet 10.204.9.0/28 on AWS. How many usable IPs?

  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Medium Create a subnet in one AZ

Subnets split the VPC range and each one lives in exactly one AZ.

In vpc-0ef35315aedeadbee, create subnet 10.6.1.0/24 in ap-south-1a.

  1. Read the task and decide which AWS service it is about.
  2. Write aws, then the service name, then the operation (the action word).
  3. Add each needed flag (--name) followed by its value from the task.
  4. Flags can be in any order. Click Check answer.

Medium Do these VPCs overlap?

Peering fails when ranges overlap.

Can VPC 10.204.0.0/16 peer with VPC 10.204.128.0/17? Answer yes or no.

  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Hard Range of a /26

Knowing the range stops subnets from overlapping.

Write the first and last address of 10.204.3.64/26 (like a.b.c.d - e.f.g.h).

  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Hard Pick the smallest prefix

Right-sizing saves address space.

A subnet must hold 100 servers on AWS. What is the largest prefix number (smallest subnet) that fits? Answer like /25.

  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.

Hard Split a /24 into two

Public and private subnets often split one block.

Split 10.204.8.0/24 into two equal subnets. Write both CIDRs separated by a comma.

  1. Write down the numbers the task gives you.
  2. Work it out step by step on paper.
  3. Type only the final answer in the box.
  4. Click Check answer.