Internet and Security - Mock Exam 3
Questa pagina non ha ancora la versione ripasso: qui sotto c'è il testo completo.
In questa pagina 13
Mock exam built on the model of the written exams and official simulations of the equivalent Italian course Internet (UniPD): the practical module has two exercises (12 + 8 points) on transport-layer calculations and on network configuration, as in those papers. The theory module of the real papers of this course is not public: the ten quizzes (four options, one correct, 1 point each) are written on the course notes, with at least four on Network Security (here five). The official laboratory test is not simulated; Exercise 2 is its written counterpart, with the commands to type in Katharà. The numbers of questions, the points and the duration are a proposal: 30 points in total (quizzes , Exercise 1 of 12 points, Exercise 2 of 8 points), 2 hours, quizzes without material and the exercises with the notes. All numerical results were checked with Python scripts (TCP rounds, send-rate formula, ALOHA and CSMA throughput, RSA, the ipaddress module for addresses and routes, and a simulation of the netfilter rules on a list of test packets).
Theory module
Quiz 1
A host asks its local DNS server for the address of www.assoc.example.org. The local DNS has in its cache the address of the server of the org top-level domain, but nothing about example.org. It queries the other servers iteratively, and processing times are negligible. The round-trip times are: host to local DNS ms; local DNS to a root server ms; local DNS to the org server ms; local DNS to the authoritative server of example.org ms. How long does the host wait for the address?
- a) ms
- b) ms
- c) ms
- d) ms
Show the result
Answer c: ms.
Show the full solution
Each question-answer pair costs one RTT with its partner (DNS - Domain Name SystemDNS translates names such as www.amazon.com into IP addresses; it is a distributed hierarchical database (an inverted tree of up to 128 levels, with 13 root servers and domains registered through ICANN-accredited registrars), each ISP has a local DNS whose address the host gets from DHCP, the host asks it (usually over UDP) and it queries root, top-level and organisation servers, every server caches what it learns marking answers as non-authoritative until the TTL expires, records are (name, type, value, class, TTL), with NAT the DNS must return the public address, and there are four types of attack including cache poisoning.DNS - Domain Name System →). The root server is skipped because the address of the org server is already cached. The sequence is: host to local DNS ( ms), local DNS to the org server, which answers "ask the authoritative server of example.org" ( ms), local DNS to the authoritative server, which returns the address ( ms), and the answer to the host is already counted in the first RTT. Total ms.
The other options are typical mistakes: a is the full resolution with empty cache, ms; b assumes that the address of the authoritative server was cached too (); d asks the root server and skips the org server ().
Quiz 2
A web cache (proxy) sits in front of a server and every request crosses it. A request answered from the cache (hit) takes ms; a request that is not in the cache (miss) takes the same ms plus ms to fetch the object from the origin server. The hit ratio is . What is the mean response time?
- a) ms
- b) ms
- c) ms
- d) ms
Show the result
Answer a: ms.
Show the full solution
In HTTP and the WebThe application layer is the top of the stack and only uses transport services; the Web is a distributed client-server hypertext service whose pages have URLs of the form protocol://host:port/path; HTTP runs over TCP (server port 80), is stateless and uses text messages (request or status line, headers, blank line, body) with methods GET, POST, HEAD, PUT, DELETE and status codes 2xx to 5xx; a page with N embedded objects needs 2(N+1) RTT with non-persistent connections and N+2 RTT with a persistent connection (transmission times neglected), cookies give HTTP a memory through Set-Cookie and Cookie headers, and a proxy (web cache) keeps copies of recent responses to cut load, traffic and delay.HTTP and the Web → the mean time with a cache is with , because a miss still goes through the cache. Here ms and Equivalently ms. Option b forgets that a miss also pays the ms of the cache (); c is , which counts only the hits as if they took the origin time; d is the time without any cache. The cache pays off here since , that is percent.
Quiz 3
A mail client sends an attachment of bytes with MIME. The attachment is encoded in base64 (line breaks are not counted). How many characters does the encoded text contain, and how many of them are the padding character =?
- a) characters, no padding
- b) characters, one
= - c) characters, one
= - d) characters, two
=
Show the result
Answer d: characters, two =.
Show the full solution
Base64 takes bytes ( bits) at a time and writes them as characters of bits each (E-mail - SMTP, POP3, IMAP and MIMEE-mail is a one-way transaction, so intermediate servers are used: two user agents (UA), push client-server programs (MTA, protocol SMTP, from sender to its server and between servers) and a pull program (MAA, POP3 or IMAP4, from the recipient's server to the recipient); SMTP uses TCP port 25 with commands HELO, MAIL FROM, RCPT TO, DATA, QUIT and three-digit replies (220 ready, 250 ok, 354 start mail input, 221 closing, 421 unavailable) in three phases (opening, transfer, closing), POP3 (port 110) downloads messages one by one after login while IMAP4 (port 143) adds header preview, search, partial download and server-side folders, and MIME turns non-ASCII data into 7-bit ASCII, for example with base64 (3 bytes become 4 characters).E-mail - SMTP, POP3, IMAP and MIME →). Since , there are complete groups, which give characters, and one byte is left. A single byte has bits: it fills one group of bits and a second group of bits completed with zeros, so it gives characters followed by ==, in total characters. The length is , with two padding characters (a final remainder of bytes would give one =). Option a is rounded down, which ignores the incomplete group; b and c have the wrong length or the wrong number of =. A frequent mistake is to think that base64 encrypts: it is only an encoding, reversible by anybody.
Quiz 4
Router R1 learned the route to network N7 (cost ) from the RIP update of its neighbour R2 received at time . R2 then fails and R1 never receives any other information about N7. What is the state of that route at s?
- a) It is still valid with cost : the router deletes a route only s after the last update.
- b) It has expired, its cost is , and it is still in the table; it will be deleted at s.
- c) It has already been deleted from the table, because it expired at s.
- d) It has expired with cost and stays in the table until s.
Show the result
Answer b.
Show the full solution
In Internet Routing Protocols - RIP, OSPF and BGPInternet routing is hierarchical for scalability and administrative autonomy: each ISP is an autonomous system (AS) and uses an interior protocol inside it, either RIP (distance vector, hop count with maximum 15, updates about every 30 s, over UDP port 520) or OSPF (link state with Dijkstra, areas attached to backbone area 0, five LSA types, carried directly in IP), while BGP4 (path vector over TCP port 179, eBGP between ASes and iBGP inside) connects ASes with policy-based route choice and loop avoidance by discarding paths that contain the own AS.Internet Routing Protocols - RIP, OSPF and BGP → a RIP route has an expiration timer of s: if no update refreshes it, at s the route expires and its cost becomes , that is infinity (unreachable). Then the garbage-collection timer of s starts, during which the route stays in the table with cost so that the neighbours learn that it is invalid; it is deleted at s. At s the route is therefore expired, with cost , but not yet removed. Option a ignores the expiration timer; c forgets the s of garbage collection; d uses the wrong cost: is the largest valid cost, while means unreachable.
Quiz 5
In an OSPF autonomous system a router of area must reach a network external to the AS. That network is announced by an AS boundary router (ASBR) placed in area . Which pair of LSA types lets the router of area learn both the external network and the position of the ASBR?
- a) types and
- b) types and
- c) types and
- d) types and
Show the result
Answer c: types and .
Show the full solution
From Internet Routing Protocols - RIP, OSPF and BGPInternet routing is hierarchical for scalability and administrative autonomy: each ISP is an autonomous system (AS) and uses an interior protocol inside it, either RIP (distance vector, hop count with maximum 15, updates about every 30 s, over UDP port 520) or OSPF (link state with Dijkstra, areas attached to backbone area 0, five LSA types, carried directly in IP), while BGP4 (path vector over TCP port 179, eBGP between ASes and iBGP inside) connects ASes with policy-based route choice and loop avoidance by discarding paths that contain the own AS.Internet Routing Protocols - RIP, OSPF and BGP →: the type 5 LSA (external link) is generated by the ASBR and announces the external network in the whole OSPF domain, but a router of another area does not know how to reach that ASBR; the area border router of area therefore sends a type 4 LSA (summary link to the AS), which tells where the ASBR is. Types and (router link and network link) stay inside one area, and type (summary link to network) announces networks of the AS, not the ASBR: so a, b and d cannot give both pieces of information.
Quiz 6
Bob chooses the RSA primes and and publishes the public key . Alice wants to send him the message encrypted with the plain RSA formula. Which value does she send?
- a)
- b)
- c)
- d)
Show the result
Answer a: .
Show the full solution
In Public-Key Cryptography, RSA and TLSPublic-key cryptography uses a public key to encrypt and a private key to decrypt; certificates issued by a Certificate Authority bind identities to public keys; digital signatures give authenticity, integrity and non-repudiation; RSA relies on the difficulty of factoring; TLS combines certificates, a symmetric session key (derived with Diffie-Hellman since TLS 1.3) and MACs.Public-Key Cryptography, RSA and TLS → encryption is , with the recipient's public key: . Use square-and-multiply, reducing at each step: ; (); (); (). So .
Check: , , and the private exponent is (); decrypting, . Options b and d are intermediate values of the computation ( and ); c is the product , not a power.
Quiz 7
Alice sends Bob a message together with her digital signature, so that Bob can check authenticity, integrity and non-repudiation. Which procedure is correct?
- a) Alice encrypts the whole message with Bob's public key; Bob decrypts it with his private key and the message is authenticated.
- b) Alice encrypts the hash of the message with Bob's public key; Bob decrypts it with his private key and compares it with the hash he computes.
- c) Alice encrypts the hash of the message with her public key; Bob decrypts it with Alice's private key and compares it with the hash he computes.
- d) Alice encrypts the hash of the message with her private key; Bob decrypts the signature with Alice's public key and compares it with the hash he computes.
Show the result
Answer d.
Show the full solution
A signature uses the sender's private key and is verified with the sender's public key (Public-Key Cryptography, RSA and TLSPublic-key cryptography uses a public key to encrypt and a private key to decrypt; certificates issued by a Certificate Authority bind identities to public keys; digital signatures give authenticity, integrity and non-repudiation; RSA relies on the difficulty of factoring; TLS combines certificates, a symmetric session key (derived with Diffie-Hellman since TLS 1.3) and MACs.Public-Key Cryptography, RSA and TLS →). Alice computes the hash of the message (for example SHA-256), encrypts it with her private key and sends message and signature; Bob computes the hash of the received message, decrypts the signature with Alice's public key and accepts if the two hashes are equal. The hash is signed because it is short and fast to process. Only Alice can produce the signature (non-repudiation and authenticity), and any change of the message changes the hash (integrity).
Options a and b use the recipient's public key: that is the procedure for confidentiality, which anybody can perform (Bob's public key is public), so nobody is authenticated. Option c reverses the keys: Bob does not know Alice's private key, and anybody can encrypt with Alice's public key, so even a matching hash would prove nothing about who sent the message.
Quiz 8
A browser opens https://www.shop.example and receives the certificate of the site. Which checks must it do before trusting the public key in the certificate?
- a) It asks the site to encrypt a random string with its private key and accepts any certificate that the site itself has signed.
- b) It verifies the CA signature with the CA public key, going up the chain of trust to a root CA already present in the system, and checks the validity dates and that the name in the certificate matches the site.
- c) It sends the certificate to the site's DNS server, which confirms that the IP address of the site is the one in the certificate.
- d) It decrypts the certificate with the site's public key and accepts it if the result is readable text.
Show the result
Answer b.
Show the full solution
A certificate binds a name to a public key and is signed with the private key of a Certificate Authority; anyone who has the CA public key can verify it (Public-Key Cryptography, RSA and TLSPublic-key cryptography uses a public key to encrypt and a private key to decrypt; certificates issued by a Certificate Authority bind identities to public keys; digital signatures give authenticity, integrity and non-repudiation; RSA relies on the difficulty of factoring; TLS combines certificates, a symmetric session key (derived with Diffie-Hellman since TLS 1.3) and MACs.Public-Key Cryptography, RSA and TLS →). The browser therefore verifies the signature with the CA public key and, if the CA is not a root, goes up the chain of trust until it reaches a root CA already installed in the operating system or in the browser; it also checks that the certificate is within its validity period and that the site name matches the one requested. Only then does it use the public key to set up the session (authentication of the server).
Option a trusts a self-signed certificate: anybody can sign a certificate for any name, so it proves nothing. Option c has nothing to do with certificates: DNS maps names to addresses and does not vouch for a key. Option d is circular: the site's public key is exactly what is being certified, and "readable text" is not a signature check.
Quiz 9
A Linux router has eth0 on the private LAN 192.168.1.0/24 and eth1 on the Internet with the public address 130.10.4.2. The FORWARD chain has policy DROP. The administrator wants the web server 192.168.1.50 (port ) to be reachable from the Internet at the address 130.10.4.2 and port . Which pair of rules does it?
- a)
iptables --table nat --append POSTROUTING --protocol tcp --destination-port 8080 --jump DNAT --to 192.168.1.50:80and the forwarding ruleiptables --table filter --append FORWARD --protocol tcp --destination 192.168.1.50 --destination-port 80 --in-interface eth1 --out-interface eth0 --jump ACCEPT - b)
iptables --table nat --append PREROUTING --protocol tcp --destination 130.10.4.2 --destination-port 8080 --in-interface eth1 --jump DNAT --to 192.168.1.50:80andiptables --table filter --append FORWARD --protocol tcp --destination 192.168.1.50 --destination-port 8080 --in-interface eth1 --out-interface eth0 --jump ACCEPT - c)
iptables --table nat --append PREROUTING --protocol tcp --destination 130.10.4.2 --destination-port 8080 --in-interface eth1 --jump DNAT --to 192.168.1.50:80andiptables --table filter --append FORWARD --protocol tcp --destination 192.168.1.50 --destination-port 80 --in-interface eth1 --out-interface eth0 --jump ACCEPT - d)
iptables --table nat --append PREROUTING --protocol tcp --destination 130.10.4.2 --destination-port 8080 --in-interface eth1 --jump DNAT --to 192.168.1.50:80andiptables --table filter --append INPUT --protocol tcp --destination 192.168.1.50 --destination-port 80 --jump ACCEPT
Show the result
Answer c.
Show the full solution
From Firewall Configuration with iptables in KatharàLab 6 configures a packet-filter firewall on Linux with iptables (NetFilter): tables filter, nat, mangle and raw hold chains of rules, the first matching rule wins, otherwise the default policy applies; three experiences cover a firewall protecting a host (INPUT with DROP policy plus loopback, ping, SSH and ESTABLISHED,RELATED), a firewall on a LAN router (FORWARD) and NAT with SNAT and DNAT.Firewall Configuration with iptables in Katharà →: DNAT must act before routing, so it goes in the PREROUTING chain of the nat table; the packet then is routed towards the LAN, and since it is forwarded and not for the router itself, the filtering rule goes in FORWARD. At that point the packet already carries the translated destination 192.168.1.50:80, so the rule must test port , not .
Option a puts DNAT in POSTROUTING, which is after routing and is used for SNAT; b has the correct DNAT but a FORWARD rule on port , which no packet matches any more (the packets are dropped by the policy); d uses INPUT, which sees only packets for the router: the forwarded packets would never match.
Quiz 10
An attacker sends ICMP echo requests at kbit/s to the broadcast address of a network where hosts answer, with the source address forged to be the victim's. Replies have the same size as the requests. What does the victim receive, and which security goal is attacked?
- a) About Mbit/s of echo replies; the attack hits availability.
- b) About Mbit/s of echo requests; the attack hits availability.
- c) About Mbit/s of echo replies; the attack hits confidentiality.
- d) About kbit/s of echo replies; the attack hits availability.
Show the result
Answer a.
Show the full solution
This is the Smurf attack of Network Security - Threats and AttacksA threat is any event that can violate a security goal (confidentiality, integrity, availability, accountability, privacy) and its realisation is an attack; security services and mechanisms counter the threats, and sniffing and spoofing underlie the main network attacks, DoS and man-in-the-middle.Network Security - Threats and Attacks →: the broadcast request is answered by every host, and the replies go to the forged source address, that is to the victim. The amplification factor equals the number of answering hosts, , so the victim receives Mbit/s of echo replies, enough to saturate a Fast Ethernet link. The goal hit is availability (a denial of service): the attacker does not read or change any data of the victim. Option b forgets that the victim never sees the requests (the attacker's address is not in the replies) and ignores the amplification; c has the right traffic but the wrong goal (confidentiality is violated by eavesdropping, not by flooding); d divides by instead of multiplying. Today the attack is rare, since routers normally do not forward directed broadcasts.
Practical module
Exercise 1 (points 12)
Host A (client) and host B (server) are connected through the routers R1 and R2 in a chain; the links are:
| link | ends | capacity | propagation |
|---|---|---|---|
| A - R1 | Mbit/s | ms | |
| R1 - R2 | Mbit/s | ms | |
| R2 - B | Mbit/s | ms |
The routers work in store-and-forward mode. Segments carry bytes; headers, SYN, ACK and processing times are negligible (only transmission and propagation count). B acknowledges every segment as soon as it arrives. Neglect all other traffic.
(a) (3 points) Connection opening and flow control. The initial sequence numbers are for A and for B; A announces bytes and B announces bytes (constant). A sends its first data segment together with the third segment of the opening.
- Give flags, sequence number, acknowledgment number and window of the three segments of the three-way handshake.
- Give the sequence and acknowledgment numbers of the first two data segments sent by A and of the ACK sent by B for the first one.
- Compute the RTT of a segment (from the start of its transmission to the arrival of its ACK), the bandwidth-delay product of the connection in segments, and the send window that allows a continuous flow. Does the window announced by B allow a continuous flow? What is the highest throughput that flow control alone would allow?
(b) (3 points) Transfer with a timeout. A sends a file of bytes. Initially MSS and bytes; data start as soon as possible after the opening. Time is the instant A sends the SYN; the transfer ends when the last ACK arrives. Use the round convention of the course (in each round the sender sends a window and waits for its ACKs; if it goes to , otherwise it adds MSS; ).
- Compute the total time if there are no losses.
- Now all the segments of the sixth window are lost (a burst), so no ACK comes back. The retransmission timeout is ms, counted from the instant the first segment of the lost window is sent. After the timeout the segments are sent again with the rules of the course. Compute after the timeout, the window of every round and the total time.
(c) (2 points) Throughput and analytical model.
- Compute the average throughput (goodput) of the transfer of point (b.2) in Mbit/s, and its ratio to the bottleneck capacity.
- Consider now a very long transfer on the same path in congestion avoidance, with (one ACK per segment), s and maximum window . The packets are lost independently on the links with probabilities on , on and on . Compute the loss probability of the path, the send rate of the approximate model in segments per second and in Mbit/s (including the window cap), and say why it differs from the throughput of point (c.1).
(d) (2 points) Slotted ALOHA. Several stations share a Mbit/s channel with slotted ALOHA; frames have bytes and the slot is equal to the frame time. The new frames of all stations form a Poisson process of rate frames/s. The propagation time is ms and the mean backoff is ms.
- Find the two offered loads compatible with the throughput, say which one is stable, and compute the success probability and the mean number of retransmissions per frame at the stable point.
- Compute the mean delay of a frame at the stable point.
- What is the largest rate for which a stable operating point exists?
(e) (2 points) Non-persistent CSMA. The same stations, on the same channel and with the same frames, use non-persistent CSMA with an offered load . Compute the throughput (normalized and in Mbit/s) for ms and for ms, and compare it with slotted ALOHA at the same and with its maximum.
Show the result
(a)
- SYN: SN , window . SYN+ACK: SN , AN , window . ACK: SN , AN , window .
- First data segment SN (AN ), second SN (AN ); B's ACK: SN , AN , window .
- ms; kbit MSS; MSS. MSS : not continuous. Flow control alone allows Mbit/s (about percent of the bottleneck).
(b)
- ms (windows ).
- MSS; windows after the timeout ; ms (the loss costs ms).
(c)
- Mbit/s ( segments/s), percent of Mbit/s.
- ; segments/s Mbit/s (the cap segments/s does not apply); the model is about percent below the measured goodput of the short transfer.
(d)
- ms, : (stable) and (unstable); ; retransmissions per frame.
- ms.
- frames/s.
(e) : ( Mbit/s); : ( Mbit/s). Slotted ALOHA at : ; maximum .
Show the full solution
(a) Opening and flow control. The three-way handshake of TCP - Connection, Reliability and Flow ControlTCP is the connection-oriented, reliable transport protocol that turns IP's unreliable service into an ordered byte stream without errors or duplicates; the connection opens with a three-way handshake (SYN, SYN+ACK, ACK) and closes with FIN segments, bytes are numbered (sequence number = first byte of the segment, cumulative ACK = next byte expected), the sender may transmit min(rwnd, cwnd) unacknowledged bytes (rwnd, the receiver window in a 16-bit field, is flow control), errors are handled with checksum, ACKs, retransmission timeout and fast retransmit after three duplicate ACKs, and to fill the pipe the window must reach the bandwidth-delay product, with maximum throughput MSS times Wmax over RTT.TCP - Connection, Reliability and Flow Control →: SYN and FIN consume one sequence number, a plain ACK none. The window field of each segment is the receive window announced by its sender.
| segment | from | flags | SN | AN | window |
|---|---|---|---|---|---|
| 1 | A to B | SYN | none | ||
| 2 | B to A | SYN, ACK | |||
| 3 | A to B | ACK (with the first data) |
B's SYN consumed the number , so its next byte is : the AN of A's segments stays because B sends no data. A's SYN consumed , so the first data byte is . The first data segment (SN ) carries bytes to ; the second has SN . B acknowledges the first with AN (next byte expected); its own SN is and the window stays if the application reads at once.
Times. Transmission time of a segment with bit: : ms; : ms; : ms. A data segment arrives at B after ms (store-and-forward: each link transmits the whole segment after it has been received); the ACK is negligible and takes only the propagations back: ms. Hence The bottleneck is ( Mbit/s): one segment every ms. The BDP is bit, that is MSS (equivalently ). To keep the bottleneck always busy at least segments must be in flight, so MSS. B announces MSS : the sender can never fill the pipe, flow control is the limit (the network is not saturated). With segments per RTT the maximum throughput is that is percent of the bottleneck. Typical errors: using as bottleneck (it is the fastest link); counting the transmission time in the ACK; rounding down to .
(b) Transfer with a timeout. The file has segments; MSS and MSS. The opening takes ms (SYN and SYN+ACK have negligible length, only propagation), and the data start at ms (TCP Congestion ControlCongestion arises when fast links feed a slow one, router queues fill and packets are lost or delayed, possibly up to network collapse; TCP controls its congestion window cwnd using loss feedback (timeout or three duplicate ACKs): slow start doubles cwnd every RTT up to the threshold ssthresh, then congestion avoidance adds 1 MSS per RTT, and on a loss ssthresh becomes W/2; variants differ in reaction to three dupACKs: Tahoe restarts from cwnd=1, Reno uses fast recovery (ssthresh=cwnd/2, cwnd=ssthresh+3, +1 per further dupACK), NewReno handles partial ACKs and recovers several losses in one window, SACK acknowledges received blocks and resends only what is missing.TCP Congestion Control →).
(b.1) No losses. Windows: (the doubling stops at : ), then congestion avoidance and keeps it at . Segments sent: give ; then five windows of give ; the last window has the remaining . All the windows are below the BDP of MSS, so each round lasts one RTT (the sender sends the window and waits for the first ACK). The last window ( segments) ends after its first segment arrives, plus the RTT: The full rounds are those of the first windows; the last has .
(b.2) Loss of the sixth window. The windows before are ( segments delivered); the sixth would be MSS () and is lost completely. Nothing arrives, so no duplicate ACKs are generated: only the timeout can detect the loss (TCP Retransmission Timeout EstimationTCP retransmits a segment when its ACK does not arrive within the retransmission timeout RTO, which must track the round-trip time: too short causes spurious retransmissions, too long slows recovery; the RTT is measured with one timer per connection, smoothed with an exponential moving average SRTT = (1-alpha) SRTT + alpha rtt with alpha = 1/8, the mean deviation MAD = (1-rho) MAD + rho |rtt - SRTT| with rho = 1/4 is added four times, RTO = SRTT + 4 MAD with a minimum of 1 s, Karn's algorithm ignores samples of retransmitted segments and doubles the RTO at each consecutive timeout up to 64 times, and for a Gaussian RTT the mean deviation equals sigma times the square root of 2 over pi, about 0.797 sigma.TCP Retransmission Timeout Estimation → for the RTO). At the timeout the window in flight was MSS: and a new slow start begins (a timeout is a severe signal, so and not ). The segments of the lost window are sent again, together with the rest of the file: segments remain. Windows after the timeout: (reaching ), then congestion avoidance and limited by , last ; check .
| round | window (MSS) | segments delivered in all | start (ms) |
|---|---|---|---|
| 1 | 1 | 1 | 20.00 |
| 2 | 2 | 3 | 42.64 |
| 3 | 4 | 7 | 65.28 |
| 4 | 6 | 13 | 87.92 |
| 5 | 7 | 20 | 110.56 |
| 6 | 8, all lost | 20 | 133.20 |
| timeout | |||
| 7 | 1 | 21 | 193.20 |
| 8 | 2 | 23 | 215.84 |
| 9 | 4 | 27 | 238.48 |
| 10 | 5 | 32 | 261.12 |
| 11 | 6 | 38 | 283.76 |
| 12 | 7 | 45 | 306.40 |
| 13 | 8 | 53 | 329.04 |
| 14 | 9 | 62 | 351.68 |
| 15 | 10 | 72 | 374.32 |
| 16 | 10 | 82 | 396.96 |
| 17 | 10 | 92 | 419.60 |
| 18 | 8 | 100 | 442.24 |
Every window is below , so each round lasts ms; the last window of segments needs more: The timeout costs ms: the ms of waiting, plus the rounds spent in slow start and in the reduced congestion avoidance. Typical errors: computing from a window of (the window really in flight was ); keeping as after three duplicate ACKs; counting the lost segments as delivered; forgetting that after the growth is linear.
(c) Throughput and model.
(c.1) The goodput is the file size over the total time: Mbit/s ( segments/s), that is percent of the bottleneck capacity: far below the Mbit/s allowed by flow control, because of the slow start phases and the timeout.
(c.2) The loss probability of the path is the complement of the probability that a packet survives all the links: The approximate model of Analytical Model of TCP Send RateThe analytical model gives the long-term send rate B (segments per second) of a TCP Reno flow as a function of the loss probability p, the RTT, the delayed-ACK parameter b and the timeout T0; time is divided into rounds of one RTT, the window cycle between two losses signalled by three duplicate ACKs (TDP) has mean window E[W] = (2-3b)/(3b) + sqrt(((3b-2)/(3b))^2 + 8(1-p)/(3bp)) and the rate is B = E[Y]/E[A], which for small p gives the square-root formula B = (1/RTT) sqrt(3/(2bp)) (about 1.22/(RTT sqrt p) for b=1 and 0.87/(RTT sqrt p) for b=2); timeouts add the probability Q that a loss ends in timeout, giving B = (E[Y] + Q E[R]) / (E[A] + Q E[Z_TO]), and a maximum window Wmax caps the rate at Wmax/RTT.Analytical Model of TCP Send Rate → with , s, ms:
- first term: s;
- timeout probability: , below , so ;
- ; second term: s;
- segments/s.
The cap is segments/s: not binding, segments/s. In bits, Mbit/s (not : the payload must be converted to bits). The goodput of the model would be Mbit/s.
The model gives Mbit/s against Mbit/s of the transfer (about percent less), and the two numbers are not expected to coincide: the model describes the long-term average of a flow in congestion avoidance with random independent losses and a timeout of s, while the transfer is short, starts with slow start (not modelled) and has a single burst loss with a timeout of ms. The simple square-root formula segments/s would ignore the timeouts and be wrong by a factor : at percent timeouts matter.
(d) Slotted ALOHA. Frame time ms; in steady state the throughput equals the new traffic, (Performance of Multiple Access ProtocolsWith Poisson arrivals, the success probability of a frame is the probability that no other frame arrives in the vulnerable time: pure ALOHA P_S = e^(-2G), throughput S = G e^(-2G) with maximum 1/(2e) = 0.18 at G = 1/2; slotted ALOHA S = G e^(-G) with maximum 1/e = 0.37 at G = 1; non-persistent CSMA with a = tau_p/t_F: S = G e^(-aG) / (G(1+2a) + e^(-aG)), which tends to 1 as a tends to 0 but collapses for large a, where slotted ALOHA is better. For TDMA (M/D/1) E[T] = t_F (N_u/2 + S N_u / (2(1-S)) + 1 + a) and for FDMA E[T] = t_F (N_u + S N_u / (2(1-S)) + a): FDMA is slower by t_F (N_u/2 - 1).Performance of Multiple Access Protocols →, Multiple Access Protocols - ALOHA and CSMAWhen several stations share a medium a medium access (MAC) protocol must decide who transmits. Random access: pure ALOHA (transmit immediately, vulnerable time 2 t_F), slotted ALOHA (start only at slot boundaries, vulnerable t_F), CSMA (listen before talking, vulnerable tau_p) with 1-persistent, non-persistent and p-persistent variants, CSMA/CD (detects collisions while transmitting: needs t_F >= 2 tau_p, hence a minimum frame) and the Wi-Fi CSMA/CA (IFS, contention window with backoff, ACK, RTS/CTS and NAV). Controlled access: reservation, polling, token. Channelization: FDMA, TDMA, OFDMA, CDMA, SDMA.Multiple Access Protocols - ALOHA and CSMA →).
(d.1) For slotted ALOHA , so has two solutions. Low branch: starting from gives . High branch: starting from gives . The point is stable (if rises, is above the arrival rate and the load decreases); is unstable (a peak of traffic beyond it makes the load grow without limit). At : Check: ✓.
(d.2) Mean delay: . The fixed part is ms; each retransmission costs ms; so ms.
(d.3) A stable point exists only if , that is frames/s ( there); above it the system is never stable. Typical errors: using (pure ALOHA); choosing as the operating point; forgetting the half slot of waiting in the delay.
(e) Non-persistent CSMA. The formula of the notes is with .
- ms: , : , that is Mbit/s.
- ms: , : , that is Mbit/s.
Slotted ALOHA at gives ( Mbit/s) and cannot exceed . With a short propagation time () CSMA at delivers more than slotted ALOHA can ever do (); with the sensing information is old, many frames collide in the vulnerable period and CSMA falls far below slotted ALOHA (). Typical errors: using in seconds instead of ; applying the CSMA formula with as a rate; comparing at equal throughput instead of equal .
Exercise 2 (points 8)
A company network is emulated with Katharà. The firewall fw is a Linux router with three interfaces; r2 is an internal router. The devices and the addresses are:
| device | interface | collision domain | address |
|---|---|---|---|
| pc1 | eth0 | A | 192.168.20.10/24 |
| r2 | eth0 | A | 192.168.20.253/24 |
| r2 | eth1 | B | 192.168.21.254/24 |
| pc2 | eth0 | B | 192.168.21.10/24 |
| fw | eth0 | A | 192.168.20.254/24 |
| fw | eth1 | C | 192.168.30.14/28 |
| fw | eth2 | D | 151.12.50.2/30 |
| web | eth0 | C | 192.168.30.2/28 |
| eth0 | C | 192.168.30.3/28 |
|
| isp | eth0 | D | 151.12.50.1/30 |
| isp | eth1 | E | 93.50.8.1/24 |
| ext | eth0 | E | 93.50.8.10/24 |
A is the office LAN, B the laboratory network behind r2, C the DMZ with the web and mail servers, D the link to the provider, E the network of an external host. The devices isp and ext are already configured: isp has only its two interface networks and no other route, ext has isp as default gateway. The company has the single public address 151.12.50.2. The policy of fw is:
- LAN A and network B (together
192.168.20.0/23) can start any connection towards the Internet, with NAT; they can use only the web server (TCP ) and the mail server (TCP ) in the DMZ; pc1 and pc2 must reach each other without crossingfw. - From the Internet only TCP to the web server and TCP to the mail server are accepted, through the public address of
fw; nothing else, not evenpingtofw. - The DMZ servers can start connections to the Internet only for DNS (UDP ) and, for the mail server only, SMTP (TCP ); nothing is allowed from the DMZ towards A and B.
fwis managed with SSH (TCP ) only from pc1;fwitself can send anything. Replies to allowed connections always pass. Policies are restrictive (DROP) and rules are listed in a sensible order.
(a) (3 points) Write the lab.conf, the startup commands (interfaces and static routes) of fw, r2 and pc1, the route -n table of fw, and the command lines for pc2 and web. Explain why isp needs no static route, and what would happen to a ping from pc2 to ext if the NAT were missing.
(b) (3 points) Write the iptables commands that configure fw according to the policy (policies, INPUT, FORWARD, nat), numbering the filter rules.
(c) (2 points) For each of the following packets arriving at fw say, following the path of the packet, which rule decides (or the policy), whether it is accepted or dropped, and which translation is applied:
- P1: from pc1
192.168.20.10:41000to93.50.8.10:443, TCP SYN. - P2: from
ext93.50.8.10:50000to151.12.50.2:80, TCP SYN. - P3: from
ext93.50.8.10:50001to151.12.50.2:22, TCP SYN. - P4: from web
192.168.30.2:45000to pc1192.168.20.10:22, TCP SYN. - P5: from pc2
192.168.21.10:42000to mail192.168.30.3:25, TCP SYN. - P6: from pc2
192.168.21.10:43000tofwat192.168.20.254:22, TCP SYN. - P7: from web
192.168.30.2:80to93.50.8.10:50000, TCP SYN+ACK, reply to P2. - P8: from mail
192.168.30.3:46000to93.50.8.10:25, TCP SYN.
Show the result
(a) lab.conf: pc1[0]=A; r2[0]=A; r2[1]=B; pc2[0]=B; fw[0]=A; fw[1]=C; fw[2]=D; web[0]=C; mail[0]=C; isp[0]=D; isp[1]=E; ext[0]=E.
# fw.startup
ifconfig eth0 192.168.20.254/24 up
ifconfig eth1 192.168.30.14/28 up
ifconfig eth2 151.12.50.2/30 up
route add -net 192.168.21.0/24 gw 192.168.20.253 dev eth0
route add default gw 151.12.50.1 dev eth2
# r2.startup
ifconfig eth0 192.168.20.253/24 up
ifconfig eth1 192.168.21.254/24 up
route add default gw 192.168.20.254 dev eth0
# pc1.startup
ifconfig eth0 192.168.20.10/24 up
route add -net 192.168.21.0/24 gw 192.168.20.253 dev eth0
route add default gw 192.168.20.254 dev eth0
# pc2.startup
ifconfig eth0 192.168.21.10/24 up
route add default gw 192.168.21.254 dev eth0
# web.startup (mail.startup: address 192.168.30.3/28)
ifconfig eth0 192.168.30.2/28 up
route add default gw 192.168.30.14 dev eth0Table of fw (five rows):
| Destination | Gateway | Genmask | Flags | Iface |
|---|---|---|---|---|
| 151.12.50.0 | * | 255.255.255.252 | U | eth2 |
| 192.168.20.0 | * | 255.255.255.0 | U | eth0 |
| 192.168.21.0 | 192.168.20.253 | 255.255.255.0 | UG | eth0 |
| 192.168.30.0 | * | 255.255.255.240 | U | eth1 |
| 0.0.0.0 | 151.12.50.1 | 0.0.0.0 | UG | eth2 |
isp needs no route because the packets reach it with source 151.12.50.2 (SNAT) and the replies go back to a directly connected network. Without NAT the echo requests of pc2 would arrive at ext with the private source 192.168.21.10, but isp has no route for it: the replies are not delivered and the ping gets percent loss.
(b)
iptables --table filter --policy INPUT DROP
iptables --table filter --policy FORWARD DROP
iptables --table filter --policy OUTPUT ACCEPT
# INPUT
iptables --table filter --append INPUT --in-interface lo --jump ACCEPT # I1
iptables --table filter --append INPUT --match state --state ESTABLISHED,RELATED --jump ACCEPT # I2
iptables --table filter --append INPUT --protocol tcp --destination-port 22 --in-interface eth0 --source 192.168.20.10 --jump ACCEPT # I3
# FORWARD
iptables --table filter --append FORWARD --match state --state ESTABLISHED,RELATED --jump ACCEPT # F1
iptables --table filter --append FORWARD --in-interface eth0 --out-interface eth2 --source 192.168.20.0/23 --jump ACCEPT # F2
iptables --table filter --append FORWARD --in-interface eth0 --out-interface eth1 --protocol tcp --destination 192.168.30.2 --destination-port 80 --jump ACCEPT # F3
iptables --table filter --append FORWARD --in-interface eth0 --out-interface eth1 --protocol tcp --destination 192.168.30.3 --destination-port 25 --jump ACCEPT # F4
iptables --table filter --append FORWARD --in-interface eth2 --out-interface eth1 --protocol tcp --destination 192.168.30.2 --destination-port 80 --jump ACCEPT # F5
iptables --table filter --append FORWARD --in-interface eth2 --out-interface eth1 --protocol tcp --destination 192.168.30.3 --destination-port 25 --jump ACCEPT # F6
iptables --table filter --append FORWARD --in-interface eth1 --out-interface eth2 --protocol tcp --source 192.168.30.3 --destination-port 25 --jump ACCEPT # F7
iptables --table filter --append FORWARD --in-interface eth1 --out-interface eth2 --protocol udp --destination-port 53 --jump ACCEPT # F8
# NAT
iptables --table nat --append PREROUTING --protocol tcp --destination 151.12.50.2 --destination-port 80 --in-interface eth2 --jump DNAT --to 192.168.30.2:80
iptables --table nat --append PREROUTING --protocol tcp --destination 151.12.50.2 --destination-port 25 --in-interface eth2 --jump DNAT --to 192.168.30.3:25
iptables --table nat --append POSTROUTING --source 192.168.20.0/23 --out-interface eth2 --jump SNAT --to 151.12.50.2
iptables --table nat --append POSTROUTING --source 192.168.30.0/28 --out-interface eth2 --jump SNAT --to 151.12.50.2(c)
| packet | decided by | outcome | translation |
|---|---|---|---|
| P1 | FORWARD F2 | accepted | SNAT: source becomes 151.12.50.2:41000 |
| P2 | FORWARD F5 (after DNAT) | accepted | DNAT: destination becomes 192.168.30.2:80 |
| P3 | INPUT policy | dropped | none |
| P4 | FORWARD policy | dropped | none |
| P5 | FORWARD F4 | accepted | none |
| P6 | INPUT policy | dropped | none |
| P7 | FORWARD F1 (ESTABLISHED) | accepted | source restored to 151.12.50.2:80 (reverse of the DNAT) |
| P8 | FORWARD F7 | accepted | SNAT: source becomes 151.12.50.2:46000 |
Show the full solution
(a) Addresses and routes. Katharà (Emulating Networks with KatharàKatharà is a network emulator where every device is a Docker container joined to virtual collision domains; a lab is a folder with lab.conf (topology), one .startup file per machine and optional per-device folders; machines are configured with ifconfig, tested with ping and observed with tcpdump and Wireshark.Emulating Networks with Katharà →): each line device[i]=domain puts the interface eth i in a collision domain; devices in the same domain are on the same network. Check of the addressing: A 192.168.20.0/24, B 192.168.21.0/24, C 192.168.30.0/28 (mask 255.255.255.240, addresses, hosts .1 to .14, broadcast .15: the router takes the last usable address .14), D 151.12.50.0/30 (mask 255.255.255.252, hosts .1 and .2, broadcast .3: the minimum for a point-to-point link, Subnetting, VLSM and SupernettingSubnetting splits an address block into smaller subnets by lengthening the mask (2^s subnets when s bits are borrowed), supernetting does the opposite by shortening the prefix to merge contiguous blocks; design rules for variable-size subnets are power-of-two sizes M with M at least hosts plus 2, prefix 32 minus log2 M, and start addresses divisible by M (largest subnet first), while 2^j blocks of prefix n aggregate into one block of prefix n minus j only if contiguous and aligned.Subnetting, VLSM and Supernetting →), E 93.50.8.0/24. The two office networks aggregate into 192.168.20.0/23 (mask 255.255.254.0), and the DMZ block is outside it: a single /23 match in the rules is correct for A and B only.
Static routes (Static Routing and Diagnostic Tools in KatharàLab 2 builds by hand the routing tables of two LANs (195.11.14.0/24 and 200.1.1.0/24) joined by routers r1 and r2 over 100.0.0.8/30: an active interface adds only its directly connected network, hosts use a default route, routers need static routes in both directions, and ping, route -n, tcpdump and traceroute diagnose the result (ttl=62 after two routers).Static Routing and Diagnostic Tools in Katharà →, Forwarding and Routing TablesForwarding moves each packet one hop at a time toward its destination; it is direct when the destination is on a local network (ARP gives its MAC) and indirect otherwise (the packet goes to the next hop or default gateway given by the routing table). With netmasks, delivery is direct on interface x if the destination AND the mask equals the interface address AND the mask; otherwise the table is scanned from the longest mask (longest prefix match) and the default route 0.0.0.0/0 always matches; route aggregation shortens tables.Forwarding and Routing Tables →). When an interface is activated its network enters the table; everything else must be added.
fw: connected networks D, A and C; network B is behindr2, which is on the network A, soroute add -net 192.168.21.0/24 gw 192.168.20.253 dev eth0(the gateway must be directly reachable oneth0); everything else (Internet) goes through the provider with the default route. The Internet addresses (for example93.50.8.10) match only the default route, the private B matches the/24(longest prefix).r2: connected A and B, default towardsfw.pc1: the specific route to B throughr2is necessary because of the policy: without it, traffic from pc1 to pc2 would go tofw(default), which would send it back througheth0tor2;fwhas noFORWARDrule foreth0toeth0and would drop it. With the route, pc1 sends to pc2 throughr2only. In the other direction pc2 uses its default gatewayr2, which haseth0in the network A and delivers to pc1 directly:fwis never crossed.web,mail: default towardsfw(192.168.30.14). The route is the same for both.
All the destinations were checked reachable with these routes by a script based on the ipaddress module (hop by hop walk with longest prefix match, for every pair among pc1, pc2, web, mail and ext).
Why isp needs nothing. All the packets towards the Internet carry the source 151.12.50.2 (SNAT of part b): isp knows the network D, directly connected, so the replies reach fw, which restores the private address. The private networks 192.168.0.0/16 are not routable on the Internet (NAT and Private AddressesPrivate networks (intranets) use TCP/IP with private address blocks (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) that may be reused by different intranets but are never routed in the public Internet; to reach the Internet an intranet needs an application proxy or NAT, a router that translates private to public addresses using a NAT table and per-session mappings: Basic NAT translates only the IP address one to one, NAPT also translates the port so many sessions share one public IP, and Twice NAT adds DNS support and static mappings so sessions can also start from outside.NAT and Private Addresses →). Without NAT, a ping from pc2 would reach ext (it is routed correctly) but the echo reply to 192.168.21.10 would find no route in isp: Network unreachable, no reply. A ping without reply does not prove that the forward path is broken: two-way reachability is needed.
(b) Firewall rules. Rules of Firewall Configuration with iptables in KatharàLab 6 configures a packet-filter firewall on Linux with iptables (NetFilter): tables filter, nat, mangle and raw hold chains of rules, the first matching rule wins, otherwise the default policy applies; three experiences cover a firewall protecting a host (INPUT with DROP policy plus loopback, ping, SSH and ESTABLISHED,RELATED), a firewall on a LAN router (FORWARD) and NAT with SNAT and DNAT.Firewall Configuration with iptables in Katharà → and FirewallsA firewall blocks unauthorised traffic between networks using header information of layers 2-4: stateless packet filters apply ordered rules per packet, stateful firewalls track connections (NEW, ESTABLISHED, RELATED, INVALID), application firewalls act as proxies; in Linux netfilter provides five hooks and iptables organises rules in tables and chains.Firewalls →; the first matching rule decides, otherwise the policy. Packet paths: for the router itself PREROUTING, INPUT; forwarded PREROUTING, FORWARD, POSTROUTING; DNAT happens before routing (the filter sees the translated destination), SNAT after the filters.
- Policies.
INPUTandFORWARDtoDROP(whitelist);OUTPUTACCEPT(fwcan send anything). - INPUT. I1: loopback (local processes). I2: replies to connections opened by
fw. I3: SSH only from pc1 (192.168.20.10) arriving frometh0. Nothing else, sopingtofwand SSH from other hosts are dropped. - FORWARD. F1 first, for efficiency and generality: any packet of an existing conversation passes in both directions (replies, and the DNAT/SNAT translated connections). F2: from the offices to the Internet, any traffic; the source
192.168.20.0/23covers A and B, and the interface pair excludes the DMZ. F3, F4: offices to the DMZ, only web and mail, with the destination server specified (the rule has four criteria together). F5, F6: Internet to the DMZ, only for the two servers and ports; being after DNAT the destination is the private address and the port is the real one. F7: DMZ to the Internet, SMTP only from the mail server. F8: DNS (UDP ) from any DMZ host. No rule lets DMZ traffic reach A or B (it falls into theDROPpolicy), nor lets the Internet reach anything else. - nat. The two DNAT rules in
PREROUTING(before routing): only packets arriving frometh2with destination151.12.50.2and port or . The two SNAT rules inPOSTROUTINGreplace the private source with151.12.50.2for the packets going out ofeth2: one for the offices, one for the DMZ (the networks are not contiguous, so two rules).natrules apply only to the first packet of a connection; the conntrack mechanism translates the others and the replies.
Typical errors: forgetting lo or ESTABLISHED,RELATED (replies dropped); writing the filter rule for the DNAT'd packet with the public address or port; putting a rule in INPUT for traffic crossing the router; writing --source 192.168.20.0/24 and leaving B without Internet access; changing the policy before adding I3 when working via SSH (the session is lost); forgetting that the rules are lost at restart, so they go in fw.startup.
(c) Packets (the path is PREROUTING DNAT for new packets, routing, INPUT or FORWARD, POSTROUTING SNAT; the rule list was evaluated also with a script that simulates the first-match logic, with the routing table of fw).
- P1. No DNAT. Destination
93.50.8.10: routing onfwgiveseth2(default route).FORWARD: F1 requires ESTABLISHED or RELATED, the packet is NEW, no; F2 matches (ineth0, outeth2, source in192.168.20.0/23): accepted.POSTROUTING: first SNAT rule: source192.168.20.10:41000becomes151.12.50.2:41000. - P2.
PREROUTING: first DNAT rule matches (ineth2, TCP, destination151.12.50.2, port ): destination becomes192.168.30.2:80. Routing:192.168.30.2is in the connected network C: outeth1.FORWARD: F1 no, F2 no (ineth2), F3 and F4 require ineth0, F5 matches (ineth2, outeth1, destination192.168.30.2, port ): accepted. - P3. No DNAT rule for port . The destination
151.12.50.2is an address offw, so the packet goes toINPUT: I1 no (notlo), I2 no (NEW), I3 no (arrives frometh2, source not pc1): policyDROP. - P4. Destination
192.168.20.10: outeth0.FORWARD: F1 no; F2 requires ineth0; F3 to F6 not for this direction; F7 and F8 require outeth2: no rule, policyDROP. The DMZ cannot start connections towards the LAN. - P5. Source
192.168.21.10arrives frometh0(throughr2), destination in the DMZ: outeth1. F1 no, F2 no (out iseth1), F3 no (destination.2), F4 matches (port , destination192.168.30.3): accepted; no translation (both private, the DMZ is internal). - P6. The destination
192.168.20.254isfwitself:INPUT. I1 no, I2 no, I3 requires source192.168.20.10and the source is192.168.21.10: policyDROP. The management is allowed only to pc1, not to the whole/23. - P7. The packet is ESTABLISHED (reply of P2): conntrack restores the source to
151.12.50.2:80(the reverse of the DNAT), routing giveseth2, and F1 accepts it in the first position. No SNAT rule is needed for it. - P8. Destination
93.50.8.10: outeth2. F1 no (NEW), F2 requires ineth0, F7 matches (ineth1, outeth2, TCP, source the mail server, port ): accepted.POSTROUTING: the first SNAT rule does not match (source in the DMZ), the second matches: source192.168.30.3:46000becomes151.12.50.2:46000.
Typical errors: checking the interface or the destination before the DNAT; saying that P3 is dropped by FORWARD (it is for fw, so INPUT); accepting P6 because pc2 belongs to the same company; forgetting that P4 needs an explicit rule to be allowed.
Self-assessment grid
| part | points | what must be there for full marks | typical errors |
|---|---|---|---|
| Quiz 1-10 | the right option, with the reason | counting the root server although cached; without the cache crossing; base64 length without padding; expiration cost ; LSA types mixed; intermediate RSA values; confidentiality procedure used for a signature; trusting a self-signed certificate or skipping the name check; filter on the public port after DNAT; forgetting the amplification factor or naming the wrong goal in the Smurf attack | |
| Ex. 1 (a) | 3 | handshake numbers (SYN consumes one), ms, MSS, , flow control limit Mbit/s | wrong bottleneck; ACK with transmission time; rounded down; AN of the data segments changed |
| Ex. 1 (b) | 3 | ms without losses; and windows after the timeout; ms | from ; after a timeout; lost segments counted as delivered; last window without |
| Ex. 1 (c) | 2 | Mbit/s, , segments/s Mbit/s with a correct comment | square-root formula at large ; payload not in bits; no window cap check |
| Ex. 1 (d) | 2 | stable, , ms, frames/s | pure ALOHA formula; unstable point; missing half slot |
| Ex. 1 (e) | 2 | and , and , comparison with ALOHA | in seconds; as a rate |
| Ex. 2 (a) | 3 | lab.conf, addresses, route to B on fw and pc1, default routes, no route on isp explained, effect of missing NAT |
route without gw reachable; missing route on pc1 (traffic through fw); wrong masks |
| Ex. 2 (b) | 3 | policies, lo, ESTABLISHED,RELATED, /23 source, DNAT in PREROUTING, FORWARD with the real destination, SNAT for A, B and DMZ, SSH only from pc1 |
filter on the public address after DNAT; INPUT for forwarded traffic; DMZ left open towards the LAN |
| Ex. 2 (c) | 2 | each of the eight packets with the deciding rule and the translation | INPUT and FORWARD mixed up; DNAT order; SSH from pc2 accepted |