← Computer Network Course Design
Network lab walkthrough
Simulation of the lab networkChat framing: port of the original Java
Send packets across the network I built in the lab, two routers joined by a 64 kbit/s serial line, and watch each router look up its table and apply the access list. Then see how my chat program cuts a TCP byte stream into messages.
Section 1 is a model, not the lab hardware: addresses, routes and the ACL come from my report, and the routers follow standard forwarding rules. The console text imitates the Windows PCs. Section 2 runs the framing code from the chat program's Protocol class, rewritten in TypeScript. Section 3 draws the message flows the report describes.
The lab network
Pick an action. Static routes are configured as in the report.
Router0 routing table
Router1 routing table
Access list
PC console (simulated)
Router configuration from the report
Router0_config#interface f0/0 ip address 192.168.8.1 255.255.255.0 Router0_config#interface s0/1 ip address 192.168.0.8 255.255.255.0 encapsulation PPP physical-layer speed 64000 Router0_config#ip route 192.168.108.0 255.255.255.0 192.168.0.108 ! RIP instead of the static route: Router0_config#router rip network 192.168.8.0 network 192.168.0.0 ! ACL: Router0_config#ip access-list standard denyA deny 192.168.8.0 255.255.255.0 permit any Router0_config#interface f0/0 ip access-group denyA out
Router1_config#interface f0/0 ip address 192.168.108.1 255.255.255.0 Router1_config#interface s0/1 ip address 192.168.0.108 255.255.255.0 encapsulation PPP physical-layer speed 64000 Router1_config#ip route 192.168.8.0 255.255.255.0 192.168.0.8 ! RIP instead of the static route: Router1_config#router rip network 192.168.108.0 network 192.168.0.0
How the chat program frames a message
TCP delivers a stream of bytes, not messages. The chat program joins a type and its fields with the control character SOH (0x01), encodes the text as UTF-8 and ends each frame with the byte 0xFF, which never occurs in UTF-8.
The report names the message types; the fields shown here are only an example. An image you pick stays in your browser.
Frame on the wire
type SOH 0x01 field field end 0xFF · multi-byte UTF-8 characters are underlined
Reading frames back from the stream
The receiver's readFrame reads byte by byte until 0xFF, however TCP happened to split the stream. Here three frames are sent back to back and cut into segments of random size.
Receive buffer
Frames decoded
Message flows in the chat server
From the report's description of the server (ConnectionKeeper, one thread per client, SQLite storage). Message type names are the report's; unnamed messages are described in italics.
What the model assumes
- Forwarding: inbound ACL, longest-prefix route lookup, outbound ACL, then TTL. ICMP errors that a router creates itself skip its outbound ACLs and denied packets are answered with ICMP “administratively prohibited”, as on Cisco-style routers; I assume the DCR-2626 behaves the same.
- Times come only from the 64 kbit/s serial line (about 8.5 ms per packet each way). The lab's own tracert showed 24 ms at the second hop.
- RIP is reduced to one exchange of updates, which is all this network needs to converge. Timers, triggered updates and route aging are left out.
- The framing code in section 2 follows
Protocol.build,split,writeFrameandreadFrameas printed in the report. The rest of the chat program is not reproduced.