Chapter 1: Networking Fundamentals
1.1 Why networking matters in the cloud
Come on, friends – first question: why do we need networking in the cloud? If the Amul-style dairy runs its website on EC2 and customers simply can't see it, the problem is almost always in the IP, the port or the security group. So let's make these basics solid first.
चला मित्रांनो, पहिला प्रश्न – क्लाउडमध्ये नेटवर्किंग का लागतं? The Amul-style dairy ची वेबसाइट EC2 वर चालू केली आणि कस्टमर्सना ती दिसलीच नाही, तर प्रॉब्लेम बहुतेक IP, पोर्ट किंवा सिक्युरिटी ग्रुपमध्येच असतो. म्हणून आधी हे बेसिक्स पक्के करूया.
चलो दोस्तों, पहला सवाल – क्लाउड में नेटवर्किंग क्यों चाहिए? The Amul-style dairy की वेबसाइट EC2 पर चालू की और कस्टमर्स को वो दिखी ही नहीं, तो प्रॉब्लम ज़्यादातर IP, पोर्ट या सिक्योरिटी ग्रुप में ही होता है. इसलिए पहले ये बेसिक्स पक्के करते हैं.
In this example, the browser URL is http://203.0.113.25, using an address reserved for documentation. In your own lab, use the approved address of your instance. When the browser makes the request, your laptop must know which machine to contact (the IP address) and which program on that machine should answer (the port). On AWS you will constantly:
- open or close ports in security groups (e.g. allow 22 for SSH, 80 for HTTP),
- choose CIDR ranges for VPCs and subnets (e.g.
10.0.0.0/16), - decide between public and private IP addresses,
- attach an Elastic IP so your server's address does not change.
Ravindra Bagale's Tip
Many students think that once they get a public IP, the website will show up automatically. Not so! A browser needs both the IP (which machine) and the port (which program) – and that port must be open in the security group. If the website doesn't show, start with the current IP and intended port. Then check the internet gateway route, security group and network ACL, and confirm the web server actually listens on that port. Pay attention: having each piece is what makes the full path work!
Ravindra Bagale's Tip – मराठी
बरेच students ना वाटतं की public IP मिळाला म्हणजे website आपोआप दिसेल. तसं नाही! Browser ला IP (कोणतं machine) आणि port (कोणता program) दोन्ही लागतात – आणि तो port security group मध्ये उघडा असावा लागतो. Website नाही दिसली तर आधी हे दोन प्रश्न विचारा: IP बरोबर आहे का, आणि port उघडा आहे का? ध्यान राखो!
Ravindra Bagale's Tip – हिंदी
बहुत से students सोचते हैं कि public IP मिल गया तो website अपने आप दिखेगी. ऐसा नहीं है! Browser को IP (कौन सी machine) और port (कौन सा program) दोनों चाहिए – और वो port security group में खुला होना चाहिए. Website नहीं दिखी तो पहले ये दो सवाल पूछो: IP सही है क्या, और port खुला है क्या? ध्यान रखो!
Practice task
an Amul-style dairy chya EC2 website sathi ek chhoti list liha: server la public IP kasa milel, konte ports ughde thevayche (22 fakt My IP, 80, 443) aani database cha port 3306 ka band thevaycha. Pratyek line samor ek karan liha.
Separate reachability from a working order
Read all steps
- Name lookup
A hostname lookup supplies address information. A cached valid answer can avoid a new DNS exchange. Having an address is useful evidence, but it does not show that a route or listener works.
- Route and rules
The computer selects the next hop, and the path must permit the intended protocol and destination port. A rule allows traffic; it does not start a web-server process.
- HTTP response
An HTTP 404 is an application response. It proves a responding web component was reached; it does not prove that the requested resource exists or that every backend is healthy.
- Business result
A successful order requires the application and its dependencies to do the promised work. Verify the saved result and the meaning of the response before reporting that the whole service is healthy.
Make a working program reachable from the places it is needed
Ravi finishes the dairy’s first order page on his laptop. He opens it in the browser and sees the day’s list. Then he sends the address to Asha in another shop, and she cannot open it. Ravi and Asha have made two different tests. Ravi knows a program answers on his computer. Asha needs an address she can use from her shop, an allowed network path to it and a program ready to handle requests from that path. Their problem is not solved by copying a working file to a cloud server alone.
Cloud computing lets the team obtain computing services without running all of the physical equipment at the shop. EC2 is a way to run a virtual machine in AWS. An EC2 instance can have an operating system, web services, storage and one or more network interfaces. It can run in a network and subnet the team chose. The choice of subnet gives the instance some useful settings, such as its possible private address range and the route table for its traffic. It still takes separate decisions to control which other computers can reach which services.
Consider three people beside the dairy’s system. Customers must open the order site. Staff must open an internal packing list. The engineer must administer the server. These people have different jobs. Giving the whole internet access to a server’s administration port would solve Asha’s reachability problem only by creating an unnecessary administrative entry point. A design can allow a public website, restrict the packing list to staff, and reserve SSH access for an approved support path. Decide the audience and permitted action before choosing an IP address or rule.
In this lesson, a client makes a request and a server receives it and can supply a result. Asha’s browser is the ordering web client. When the ordering program asks for twelve milk packs in the inventory database, that same program becomes a database client. The words refer to one exchange. They do not name fixed types of computer. Draw each request as a separate connection. Then write the person or program that should be allowed to start it.
The responsibility is shared. AWS operates the infrastructure underneath the service, and the cloud team makes its design and configuration choices for the deployment. For this EC2 exercise that includes the subnet routes, attached security groups, operating-system settings and application listener. A managed cloud service can remove some work from your team, but the permissions, network policy and intended service paths still need an owner. Learn which side can observe and change each part before reporting an outage.
Write a connection plan using the job each person has
Four words make a useful first draft: source, destination, service, purpose. The source is the client that starts the conversation. The destination is the entry point it needs to reach. The service is the protocol and port used on that path. The purpose explains why the path needs to exist. Add a result you can test. If nobody can state a business purpose for a broad network allow, put that decision aside and ask what work actually needs doing.
| Source | Destination and service | Expected result |
|---|---|---|
| A customer’s browser | The named web entry point, HTTPS on TCP 443 for this example | The order form opens and the site name matches its certificate. |
| The public application load balancer | One ready private web target, HTTP on its configured application port | The target returns the designated health response and can handle an approved page request. |
| Order application | The internal inventory database endpoint, MySQL on TCP 3306 in this lesson | An approved application login reads the quantities for one test order. |
| Administrator on the approved work path | A Linux lab instance’s SSH service | The administrator reaches the instance with the expected identity and can verify its hostname. |
| A random public browser | Direct access to a private database port | The architecture has no authorized direct internet path for this connection. |
Read the table as a short set of requirements. A customer may be anywhere and use a dynamic IP, so the public website is an intentionally public service. The private database should receive requests only through the app that validates input and uses approved credentials. The application layer authorizes orders. The network layer restricts who can reach the database. Both controls protect separate points in the exercise. Even a permitted application connection can fail because its database credentials or query are wrong.
Design a smaller version first. For a disposable EC2 lab, the web program and its source files may live on one instance, so browser to web service is one connection rather than two. Later put a load balancer in front to distribute traffic or use another managed service as the public entry point. Update the connection plan when the architecture changes. Plans written for a single server do not automatically describe which inbound sources a private target should accept after a load balancer is introduced.
Keep the plan close to the code. A colleague can inspect the diagram and ask, “Which security group should allow that connection?” They can also reproduce an incident. For example, if the app team changes the target port from 8080 to 8081 during a release, both the listener and the path to the intended target need checking. The written plan gives you an expected version to compare with the deployed one.
Trace the first connection from Asha’s browser
Use https://orders.dairy.example/create as the invented address on the whiteboard. Asha types a host name, not the addresses of every machine that could serve her order. The browser gets a destination address from DNS, using available cached information if appropriate. With a load balancer, the name can lead to the managed endpoint. The selected backend can change without the user changing the URL. Treat the example name and addresses as paper values. Use your own approved hostname when testing a real service.
Next the operating system routes packets toward the selected address. The source might be Asha’s office Wi-Fi address on the local link, then a translated public IPv4 from her provider on the wider path. Her device usually sends outside destinations to its default gateway. The gateway makes another decision about the next hop. The database’s private address does not appear in the browser’s connection for the order page. A correctly configured front door receives the request and makes any new backend connection itself.
The receiving side needs an address usable on that path and a listener that can accept the connection. For the simple example of HTTPS over TCP, the browser normally uses destination port 443. It starts from a temporary client port. An inbound network rule for TCP 443 can allow Asha’s public path to reach that front door. The application or load balancer then needs to be listening on that port. Opening a rule and starting a listener are separate operations, done in different places.
HTTPS also adds the TLS exchange. The browser authenticates the site by checking the certificate for the name it requested, and establishes keys to protect the HTTP messages in transit. A certificate for a public hostname can fail a browser check when you type a raw IP address, even while the correct port and network path work. If you see a certificate warning during a test, write it down and stop before entering secrets. Verify the exact hostname and which configured listener and certificate served the response.
The browser can then request the /create path. A web service might reject that path, require a login or accept the order. That HTTP behavior gives more evidence. A response can come from a load balancer, proxy or application, depending on the situation. Verify who generated it by reading the documented status and logs. For instance, an HTTP service can answer 404 for a missing path. The response proves some server handled the request. It leaves you with the next question: was it the service and path you meant to use?
A single page can require multiple requests. The browser may load HTML, a stylesheet, and an API request for the saved order list. When Asha says “the site is white,” the first document could have loaded while the API or stylesheet failed. In the browser’s Network panel, match each row to a URL, method and status. Find the first abnormal result. A programmer can fix a bad path much faster when you can name the request, its error and where it should go.
Test inside the host and then from the intended client
Ravi sees the ordering page over SSH on the instance. The web service is running on 127.0.0.1:8000. He opens that same address on his laptop and sees a connection error. Loopback tells a computer to send traffic to a service on itself. His local curl inside SSH reaches the instance. A browser outside SSH that uses the same loopback address stays on the laptop. Write the name of the computer next to each test output before comparing them.
On Linux, ss -ltn lists TCP sockets that are listening and displays numeric addresses and ports. Read the local endpoint of the row for your intended port. A service bound to 127.0.0.1:8000 is waiting on loopback. A listener shown as 0.0.0.0:8000 usually waits on all local IPv4 interfaces. Choosing a broader bind can be appropriate for a backend that is reached from another machine on an approved private network. Keep the bind as narrow as your design permits. A network allow still needs to match the desired path separately.
Start with these observations when examining your own lab application. Run hostname to record which system accepted your command. Read the active listener and its address. Make a local HTTP request and read the response status and content. Then test from the client in your plan with the address and port it is supposed to use. If both connection results differ, place the possible causes between those two viewpoints. Look at the listener address, operating-system firewall, cloud routing and policy before reinstalling any software.
Sometimes the architecture intentionally keeps the application listener on loopback because a web proxy on the same host takes all public requests. Test that wiring as two links. First call the backend directly from the server. Next call the front door and compare the same intended route. If the first works but the second fails with an upstream error, inspect the proxy’s configured backend address and port. The application, proxy and network controls should agree about who makes each connection.
Locate the traffic in the selected AWS network
The dairy will soon have one public entry point and several private app servers. The regional Virtual Private Cloud, or VPC, gives the team an address plan and network controls for those resources. A subnet belongs to one Availability Zone. An instance resides in a subnet, with private addresses that fit the subnet’s range. A resource in a different subnet can reach it only through a permitted path. Availability decisions about multiple zones need capacity and healthy service in those zones as well as a drawing.
A route table associates destinations with next hops. Each subnet uses a particular table. To read the design, start at the packet’s source rather than where the route’s friendly name sounds appropriate. List the address range for the destination and find the most specific route that matches it. Local VPC routes cover the VPC’s associated address ranges. A public IPv4 subnet can have a route for outside destinations to an internet gateway. For direct IPv4 access from the internet, a lab instance also needs a public IPv4 association and relevant permissions and listener.
Public and private placement follow work requirements. Customers need a deliberate public entry address. The app target can use private addressing because the load balancer calls it. The database can use private addresses and accept only approved calls from the app tier. For approved package updates, the app tier can use a suitable outbound path such as a NAT gateway. Previously created private service endpoints can give a different route to supported AWS services. Write down which path is used for each of these three jobs so an outbound success is not mistaken for an authorized inbound path.
Security policies apply after or alongside routing decisions. In the lab’s same-VPC design, scope the target’s security group to the load balancer’s security group for the relevant port. Scope the database group to the app group for the service port. That policy teaches what the resources do instead of requiring engineers to update a long list of changing instance addresses. Check the exact resource’s groups, since a network interface can be associated with multiple groups. A good diagram identifies the source and destination groups for each connection.
For a subnet network ACL, read both directions and the order in which rules apply. For a security group, consider the benefit of tracking a permitted connection and allowing its replies. A strict ACL allowing a client’s inbound HTTP request but denying its return destination port can still cause a failure. Capture the addresses, protocol and ports for the two directions on paper before writing such a rule. On a working training account you can use a private paper scenario without needing to restrict an existing subnet.
Choose a test for the stage you want to prove
The strongest incident report says what happened at a specific time on a specific connection. Record the machine you used, the time and time zone, the full destination hostname and path, the intended transport and port, whether the address was IPv4 or IPv6, and the observed output. If you can collect a request identifier from the application response, include it rather than a screenshot of credentials. Ask your coworker to repeat that exact connection before you change anything.
| Observation | First likely area to check | Evidence worth collecting |
|---|---|---|
| The name has no expected address answer. | DNS name, record, resolver view and cached answer. | The exact name, answer, requested record type and test time. |
| A connection appears to hang or reports a timeout. | Current destination, route, permission path and whether the service is reachable from this client. | The source and destination in use, port, subnet associations and connection timing. |
| TCP is refused promptly by the reached destination or its path equipment. | Active listener and the runtime configuration. | The process state and listening address and port, or the control that sent the rejection. |
| TLS reports a certificate problem. | Requested name, certificate coverage, trust and endpoint configuration. | The full URL, certificate name and warning text without secrets. |
| HTTP responds with 404. | The responding service and path it matched. | The exact HTTP method and path, response and service logs. |
| HTTP works but responds slowly. | Measure connection, TLS and service response timing before deciding what is slow. | Repeated timings under the same request conditions and logs for the slow interval. |
Ping sends an ICMP test, where permitted. Its success can be useful evidence of that exchange. HTTPS and SSH use their own rules and listening services. When a firewall intentionally blocks ping, a working secure website can still respond to its own protocol. Pick a test that matches the actual client and service. From the approved source, a request to the intended hostname and port can be more informative than a general connectivity check.
Timing can tell a different story from outright failure. curl has a write-output format with values such as time_namelookup, time_connect, time_appconnect, time_starttransfer and time_total. These are elapsed checkpoints for the request, not independent values to add up. When a local page returns in ten milliseconds but the real ordering response starts after two seconds, compare those checkpoints and the app log before deciding the cloud network is slow. Time spent after a working connection can include application work and dependencies.
A cloud configuration tool and a real request have different evidence. VPC Reachability Analyzer checks modeled network configuration for a supported path. It can point to a missing route or a policy obstacle for the network resources it analyzes. A real HTTP test still checks the running process and the program’s behavior. VPC Flow Logs can show IP traffic information on a configured scope. They are useful for investigating allowed and rejected network flows. For the exact URL and app error, read the application or relevant front door’s own logs. Gather these from an authorized account; a teaching exercise does not require examining another environment.
Distinguish a slow connection from slow work after the connection
Suppose Asha says the order screen is slow at both shops, while the public welcome page is quick. Choose one controlled request to the welcome page and one approved read-only API request. Run them from the same test computer, using the same address family. Write down three or four results instead of treating one run as everyone’s experience. A cached DNS answer, a reused connection and a cached object can make repeated results different.
For a test service you operate, replace "$LAB_URL" in the command with the approved URL in quotes. This format prints the checkpoints without retaining the response body in the terminal. Inspect the status as well as the time. A quick error response is still a failed user operation.
curl -sS -o /dev/null -w 'status=%{http_code} peer=%{remote_ip} dns=%{time_namelookup} tcp=%{time_connect} tls=%{time_appconnect} first=%{time_starttransfer} total=%{time_total}\n' "$LAB_URL"
Imagine the test reports DNS lookup at 0.02 seconds, TCP at 0.07 seconds, TLS at 0.13 seconds and the first response byte at 1.93 seconds. The large gap is after TLS. At that point look at whether the API waited in the application for a database or external service. You still need a log or trace to locate the work. Now compare that with a second run where establishing the connection took a second and the response followed quickly. Those are different delays and can deserve different owners.
Cloud networking matters for every stage, but the word “slow” alone cannot tell you what to repair. Record whether the request reached a cache, load balancer or app, and which connection the timing captured. If you compare a proxy route with a direct local call, label the route differences explicitly. A team can then decide whether to inspect its DNS, network path or backend dependency first.
Try two ports on the same address and prove which program replied
You can learn this without buying an AWS resource. For the lab use a Linux or macOS computer with Python 3, a browser or curl, and access to three terminal windows. Serve only disposable text. Keep each Python process bound to 127.0.0.1 so that other computers do not use the practice service. If a listed port is already in use, pick another unused port and write down the replacement before testing. Treat any unexpected result as a reason to inspect the process, rather than stop another owner’s service.
In the first terminal, create two new practice folders inside a temporary path and give each a different response.
LAB_DIR=$(mktemp -d) || exit 1 printf 'Practice folder: %s\n' "$LAB_DIR" mkdir "$LAB_DIR/orders" "$LAB_DIR/packing" printf '%s\n' 'Dairy order desk' > "$LAB_DIR/orders/index.html" printf '%s\n' 'Dairy packing desk' > "$LAB_DIR/packing/index.html"The displayed path and the two file contents are your baseline. Note which file you want each process to expose. If folder creation failed or either folder is absent, stop before starting the service so you do not accidentally serve the wrong directory.
Start the first process in the first terminal.
python3 -m http.server 8000 --bind 127.0.0.1 --directory "$LAB_DIR/orders"Look for the message that the process is serving on the chosen port. Keep the terminal open. Start the packing process in the second terminal after setting its
LAB_DIRvariable to the exact temporary path printed above.python3 -m http.server 8001 --bind 127.0.0.1 --directory "$LAB_DIR/packing"The two service processes can coexist because they use different local ports. Each uses its own content folder.
In the third terminal, request each port. The same IP and same path will reach two different programs.
curl -sS -w '\nremote=%{remote_ip} status=%{http_code}\n' http://127.0.0.1:8000/ curl -sS -w '\nremote=%{remote_ip} status=%{http_code}\n' http://127.0.0.1:8001/Expect both to report HTTP status 200 and the same remote address. The response content differs. The first prints Dairy order desk. The second prints Dairy packing desk. Write a short conclusion: looking only at a 200 would miss that a user meant to reach the other program. Verify the expected response body, a release marker, or a known operation as part of a real application test.
Return to the packing server terminal and press Ctrl+C. Request the packing URL again, then the orders URL. Compare the outputs. The first should fail to connect if no other process accepted that port. Orders should continue to answer because that listener is a separate process. This is the simplest version of a multi-service incident: two paths to one machine can have different results.
Try one unavailable path on the still-running service. Request
/missing-training.htmlfrom the orders listener. Expect an HTTP error response rather than the same connection failure you saw when you stopped packing. This time the request reached a server, but that server could not find the path. Draw the layers that had to work before it could return that response.
If both commands return the same body, compare the terminal processes and the directory option each one used. If a command uses a proxy unexpectedly, test access from the browser or check your shell’s proxy configuration for loopback. Use an explicit known result rather than making a permanent change to a shared laptop. At the end, stop both lab server processes. Confirm and remove just the two saved practice files and use rmdir on the now-empty practice directories. There is no need to touch a real website or cloud security group to complete this lab.
Audit one permitted network path on an existing EC2 lab host
Use this exercise only if your training environment already gives you an authorized instance, a known identity and an approved connection method. Copy the instance ID and Region into your notes first so you can tell a similar name apart from your resource. An SSH hostname or public address can change, so read today’s details. If you do not have an EC2 lab yet, use the paper version and write the values you would need on both sides.
Find the network interface attached to the instance. Record its private IPv4 and public association, if any, and its security group. Find the subnet and the table actually associated with it. For a private app plot, write its expected calling tier beside the group. For an approved direct web experiment, write the public destination and intended port. You can often explain the behavior from the planned path without making any policy change.
Connect via the approved method and confirm hostname. If the application is one you operate, inspect the local listen address and test a known read-only path from the EC2 terminal. Then compare a request from the intended client using its network and public or private distance. Record whether DNS, the connection and the application request succeeded. Ping can stay disabled in a controlled lab. Make the real test on the protocol you planned.
Do not use a broad public rule to hide uncertainty about the path. When a test times out, reread the attached group and intended source, the subnet route, the current instance address, the network ACL if relevant, and the local listener. If the instance accepts your connection and rejects the login, check the AMI’s expected Linux user and approved key. Use one reversible change at a time when the lab actually needs a change. Verify after each one so you can tie the effect to the cause.
At completion, record one working observation and one failed or intentionally unavailable request from the paper or disposable exercise. Return any temporary lab controls to their planned state. If you created resources just for training, use the account’s cleanup plan to stop or remove only those named resources. Verify whether any reserved public address, load balancer, tests, volumes or logs still need to be retained or removed. This makes cleanup a checked stage rather than a guess based on a stopped instance.
Investigate a release that succeeds locally and fails for customers
Here is a practice incident using the dairy’s architecture. At 9 AM, the app team moved the order service from port 8080 to 8081 on its private targets. From an SSH shell on one updated target, the developer can open the new port. Shortly after the release, the customer receives an error from the public endpoint. The old home page still opens from a cache for some customers. The launch instance list says the instances are running. Write down the observations before guessing the cause.
The successful local call proves the intended process answers on the port and address used by that call. The cached page is useful for customer experience, but it can be served separately from an origin request. The running state says the instances exist and are active; it is not the same check as a registered app target being healthy. Compare the load balancer’s target port and health check port with where the new service listens. The target security group also needs to accept the expected app traffic from the load balancer on the right port. Confirm exactly which target groups are used for the customer’s path.
Now consider two possible resolution paths. If the configuration still points at the old port, revert the release according to the roll-back plan or change the intended target group configuration with a coordinated service test. If it already uses the correct port but a check fails, verify the health path from the target side and inspect which address it listens on. A local check can pass against loopback even when the service accepts no packets on the interface the load balancer uses. Fix the observed mismatch. Leave unrelated rules and other websites unchanged.
Finally verify from the user’s endpoint after the change. Request the order page and a safe API test, then confirm target health and the expected version marker. If the health indicator returns to green but the submit route still fails, follow the application and database arrows. Keep the first failed check and final successful test in the incident note. This practice trains you to describe a complete path, a targeted fix and the evidence that justified it.
Design for partial failure before the first incident
Suppose the dairy places one instance in each of two Availability Zones, and its front door can choose either. Ask which single dependency could still stop every order. If the app relies on one unprotected database or one unhealthy third-party connection, two working web servers are not enough for orders. Try the drawing exercise with each dependency crossed out in turn. Mark which features can still serve requests. For example, a cached list of products might remain visible while an order submission cannot be completed.
Plan where public requests enter, which layer terminates TLS and where health checks apply. A health check can ask a private target for readiness and avoid sending regular traffic until the expected status is returned. If readiness merely asks for a static file, some application failures may still look healthy. Choose a small reliable check that reflects the target’s ability to accept the intended work. Test a specific customer action separately. Monitoring needs a plain answer to the question it is trying to measure.
Capacity is also a network design issue. During a festival, more application instances need available addresses and target registration. The extra work might increase database connections as well as public requests. An old DNS name may still route to an earlier endpoint during a migration. Make a table with three events: one target fails, traffic doubles, and the front door changes. For each one write which addresses change, who retries the request and how you verify that the customer still reaches the right service.
Keep an operating procedure beside the design. It should say who can change network policies, which emergency change remains limited to the lab or service, and what proof permits rollback. The procedure helps a student move from explaining an IP address to operating a real application. The design becomes stronger when a colleague can reproduce the validation from the notes alone.
Practice reading evidence instead of guessing
- Map a new packing portal. Write one connection for the staff browser, one for the app’s inventory query and one for approved maintenance. Give each a source, destination and protocol. A strong answer gives the app and database private paths where appropriate, and explains which result proves each path.
- Find the first failing stage. The site resolves to the expected address, your network connection succeeds and the browser shows a certificate name warning. Write the next check. Use the requested name and viewer certificate first. Leave route and port rules alone unless a separate check reveals a network issue.
- Explain a one-network-only failure. The office opens the site and a student at home cannot. Draw both approaches. Compare the actual public path and destination addresses, DNS results and whether both clients use the same address family. Look for a policy that was intentionally scoped to the office. Distinguish an expected restriction from a broken service.
- Prove a successful change. A new target should answer the
/todaypath with the correct release. Choose a result that identifies the target or code and tests the path from the user’s normal entry point. Write the exact method, expected status and a recognizable non-sensitive value in the response. Check the healthy state and then make the request.
Interview questions and worked answers
What does an EC2 public address give a website developer?
It gives a usable address association for a potential public IPv4 path. The subnet route, network rules and application listener need to support the same service. Use the expected scheme and port, then verify the returned page. A public address alone is only one entry in the connectivity plan.
Why can one service respond even while another on the same host is unavailable?
Each server process can listen on a different transport and port. The network rules and app configuration can permit one and block or stop another. Check the desired endpoint specifically. The local two-port exercise demonstrates two programs using the same address independently.
How do you show that a failure reached the application?
Record the status and exact request, then match a safe request identifier or timestamp with the application’s own log. A generic front door can return an HTTP error before a target sees the request. The app’s record helps prove the request arrived in the code under investigation.
Why should you know whether you ran a command locally or over SSH?
The shell executes on the machine where the process runs. On the remote shell, loopback and filesystem paths are the remote computer’s. Confirm the hostname so you can compare logs and listeners from the right machine and avoid testing a local program by mistake.
How can a private app reach the internet while its own port stays private?
It can start an outbound connection through a designed path such as a NAT gateway. The translation handles replies to outgoing flows. The public service entrance can remain an independent load balancer or gateway. Record the two caller directions and the policy for each.
How would you document the customer-to-database path behind a load balancer?
Use three separate arrows with their sources and destinations. The browser reaches the public listener. The load balancer reaches a private target. The app reaches the database using the appropriate service and credentials. Then define an expected observation for each arrow and an end-to-end customer test.
Check which evidence answers the question
An SSH session is open while the website’s port gives a timeout. Which is established: website works, SSH has an authorized path, or all inbound traffic is allowed?
Answer and reasoning
SSH has an authorized path and working listener for that connection. The website uses a different port and possibly another program or address. Test it explicitly.
A web server responds with 404. Which is closest to the next investigation: routing every subnet again, reading the selected service and URL path, or generating a new SSH key?
Answer and reasoning
Read the service and path. An HTTP component has responded. Check whether the request went to the expected service and whether its routing or content includes that path.
The order app sees “address already in use” when starting a local test server. What should you inspect before replacing a network policy?
Answer and reasoning
Inspect the local listener for the test address and port. Another process may have already bound that endpoint. Use a different unused lab port or coordinate with the process owner.
Two sites have one IP, but one hostname fails a certificate check. What configuration can differ?
Answer and reasoning
The HTTPS certificate chosen for the requested hostname can differ. A server can be reachable on the same port while its certificate fails to cover one name.
Customers receive an old cached page, but the updated app’s new port answers locally. What would best verify the new backend is used?
Answer and reasoning
Request a relevant fresh or uncached lab path through the normal endpoint and check the expected version or behavior. Compare target health and logs to confirm the configured target accepted the request.
Revision cards
- Reachability is a path
- Write caller, destination, service and purpose. Inspect the route, address, restrictions and listener for that connection.
- Local and remote are distinct tests
- Loopback stays on the machine where you run the command. Confirm the hostname before reading interface or process output.
- A port is one service’s destination
- A host can answer on one listening port and fail on another. Verify the exact protocol and port of the real request.
- Evidence has a layer
- DNS answers name questions. TCP and TLS diagnose connection stages. HTTP status and app logs describe the request after it reached a web component.
- Protect each tier separately
- Customers use the public entry point. Scope the app and database permissions to the callers shown in their private connection plan.
Technical references
- Shared VPC security responsibilities
- Subnet routing and route association
- Direct internet gateway access
- NAT gateway behavior
- Security groups and network ACLs
- Application Load Balancer health checks and ALB troubleshooting
- VPC Reachability Analyzer and VPC Flow Logs
- HTTP status and semantics and TCP
- curl options and timing values and Python’s learning HTTP server