diff options
| author | mo khan <mo@mokhan.ca> | 2025-09-30 16:41:47 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-09-30 16:41:47 -0600 |
| commit | 9bfcea6786a88da67250b19f0096e2db9648fc30 (patch) | |
| tree | 68ac49bab1919e0fa1787833fe3034b1d9405851 | |
| parent | ec7125985ef76b73fed496b7526f2949e6b33874 (diff) | |
include the ip address that is getting routed
| -rw-r--r-- | assignments/2/README.md | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/assignments/2/README.md b/assignments/2/README.md index 36b810f..482d88a 100644 --- a/assignments/2/README.md +++ b/assignments/2/README.md @@ -342,7 +342,8 @@ class RoutingTable end def route_to(ip) - @routes.fetch(@routes.keys.find { |route| route.include?(ip) }, @default) + destination = @routes.fetch(@routes.keys.find { |route| route.include?(ip) }, @default) + "#{ip} => #{destination}" end end @@ -363,11 +364,13 @@ puts table.route_to(c) puts table.route_to(d) ``` +Result: + ```bash -Interface 1 -Router 3 -Router 2 -Router 3 +135.46.61.10 => Interface 1 +135.46.53.16 => Router 3 +192.53.40.6 => Router 2 +192.53.56.7 => Router 3 ``` ## 2.4 TCP Congestion Control (20%) |
