From 9bfcea6786a88da67250b19f0096e2db9648fc30 Mon Sep 17 00:00:00 2001 From: mo khan Date: Tue, 30 Sep 2025 16:41:47 -0600 Subject: include the ip address that is getting routed --- assignments/2/README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'assignments/2') 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%) -- cgit v1.2.3