0% found this document useful (0 votes)
110 views16 pages

H05 CSC458 Tutorial II

This document provides an overview and instructions for a programming assignment to implement a simple router. Students will write routing logic that runs on emulated network topology using Mininet to route traffic between a client and two HTTP servers. The router must handle ARP, ICMP, TCP/IP packets and generate appropriate messages. Testing can be done using ping, traceroute and HTTP requests in Mininet. Debugging advice and resources are provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views16 pages

H05 CSC458 Tutorial II

This document provides an overview and instructions for a programming assignment to implement a simple router. Students will write routing logic that runs on emulated network topology using Mininet to route traffic between a client and two HTTP servers. The router must handle ARP, ICMP, TCP/IP packets and generate appropriate messages. Testing can be done using ping, traceroute and HTTP requests in Mininet. Debugging advice and resources are provided.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

CSC458/2209 PA1

Simple Router

Based on slides by: Antonin & Yinan Liu


Jun Lin Chen
Get the up-to-date version from
https://www.cs.toronto.edu/~jlchen/csc458/pa1.pdf

CSC458/2209 - Computer Networks,


University of Toronto
Asking Question
• Please ask questions on Piazza.
Try not to give away any homework hints.
I will try my best to be responsive.

CSC458/2209 - Computer Networks,


University of Toronto
Overview
• Your are going to write a “simplified” router
➢ Given a static network topology
➢ Given a static routing table
➢ You are responsible for writing the logic to handle
incoming Ethernet frames (ICMP, ARP, IP….):
• Forward it
• Generate ICMP messages
• Drop it
• And more ...

CSC458/2209 - Computer Networks,


University of Toronto
But how to do it???
• Where will my routing logic run?

• Where will the traffic come from?

• How will I test my code?

CSC458/2209 - Computer Networks,


University of Toronto
• No hardware router
• Network topology emulated with Mininet:
your router connects 2 servers to a client
• Your router will handle real traffic
• The topology is emulated on CDF machines!
So please test it in our labs

CSC458/2209 - Computer Networks,


University of Toronto
Emulated Topology

CSC458/2209 - Computer Networks,


University of Toronto
Emulated Topology

CSC458/2209 - Computer Networks,


University of Toronto
Emulated Topology

CSC458/2209 - Computer Networks,


University of Toronto
What your routing logic needs to do?
• Route Ethernet frames between the client and the HTTP servers
• Handle ARP request and replies
➢ Maintain an ARP cache
• Handle traceroutes
➢ Generate TTL Exceeds Message
• Handle TCP/UDP packets sent to one of the routers’ interfaces
➢ Generate ICMP Port Unreachable
• Respond to ICMP echo requests

• See course webpage for full requirements:


http://www.cs.toronto.edu/~yganjali/courses/csc458/page-3/simple-router/

CSC458/2209 - Computer Networks,


University of Toronto
A rough flow chart

CSC458/2209 - Computer Networks,


University of Toronto
A rough flow chart

CSC458/2209 - Computer Networks,


University of Toronto
A rough flow chart
• Many things missing from this chart
➢ Checksums, TTLs
• Read the instructions carefully
• 500+ lines of code, so start early
• Submission:
• 8 time per day
• Last 7 days before the final submission
• The Markus server would give some feedback
• Final submission: Oct. 11st at 5pm

CSC458/2209 - Computer Networks,


University of Toronto
How to test your code?
• Test connectivity with ping from a server or the client
• Traceroute will not work well outside of Mininet:
➢ Use Mininet CLI
➢ mininet> server1 traceroute –n server2
• HTTP requests with wget, curl, lynx
• Don’t forget to test “error” cases!

CSC458/2209 - Computer Networks,


University of Toronto
Some advice
• Be through in your testing
• Do not hesitate to change the routing table
What about an incorrect routing table?
• Be careful when implementing Longest Prefix Match
• Don’t get mixed up with endinanness:
Linux is little endian
Network is big endian
➢ Try to put the calls to hton(), ntoh() in a single place
• Write good quality code
➢ Do not hardcode constants, avoid code duplication
Coding Guidelines
https://web.stanford.edu/class/cs244a/CS244aCodingGuidelines.html

CSC458/2209 - Computer Networks,


University of Toronto
Things that may be useful
• Mininet console, which supports:
tcpdump, ping, traceroute
(apt-get install traceroute on instance)
• Debug functions in sr_utils.c
➢ print_hdrs()
➢ print_addr_ip_int()
• GDB/Valgrind
• Tutorials Point:
http://www.tutorialspoint.com/unix_sockets/index.htm
• Pizza

CSC458/2209 - Computer Networks,


University of Toronto
Start reading!
http://www.cs.toronto.edu/~yganjali/courses/csc458/p
age-3/simple-router/

CSC458/2209 - Computer Networks,


University of Toronto

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy