Archive

Python Networking and Packet Tracer Coursework

First-year networking work covering subnet design, IPv4 and IPv6 routing, router administration, and small TCP and UDP client-server programmes.

  • Python
  • TCP
  • UDP
  • Cisco Packet Tracer
  • IPv4
  • IPv6
  • SSH
On this page

Designing the departmental network

My CMP109 assignment modelled a small organisation in Cisco Packet Tracer. Finance, marketing, sales, and customer-service departments each had their own LAN, with Cisco 1941 routers joined through a central 2960 switch.

Each department needed five workstations plus a default gateway. I selected /29 IPv4 networks, giving eight addresses per subnet and six usable host addresses. Consecutive ranges divided 192.168.0.0/24 into the departmental networks and a separate router transit network.

The topology used a star arrangement at the routing layer:

  • one router per department
  • one interface into the departmental LAN
  • one interface into the shared transit segment
  • static routes pointing towards the router responsible for each remote subnet

The report documented the network address, host range, broadcast address, gateway, and next hop for each segment. It also contains an addressing mistake in the recorded marketing gateway and an incomplete customer-service route. Those errors are part of the archived work and show exactly why an address plan needs to be validated rather than only described.

Adding IPv6

The same topology was configured for IPv6. I enabled IPv6 unicast routing on the routers, assigned /64 prefixes, used link-local addresses for neighbouring router hops, and allowed hosts to construct interface identifiers through EUI-64.

Working with both protocol versions on one topology helped separate the routing concepts from the notation:

  • a host still needs a local prefix and a route off the subnet
  • routers still need a path to each destination network
  • link-local addresses provide on-link communication
  • the configuration and neighbour-discovery behaviour differ from IPv4

Static routes were appropriate for the scale of this assignment. A larger or frequently changing environment would need a dynamic routing design and more deliberate failure handling.

Router administration

I restricted remote administration to SSH rather than Telnet and configured local administrative access on the routers.

The archived configuration used short passwords and 512-bit RSA keys that should not be copied into a current deployment. Cisco IOS also distinguishes between reversible password obfuscation and secure credential hashing; simply enabling the old password-encryption service does not make weak secrets safe.

The useful part of the exercise was establishing the management boundary: administrative access should use an encrypted protocol, be limited to authorised sources, use current cryptographic settings, and be kept separate from ordinary user traffic where possible.

TCP document statistics

The Python work moved the same networking concepts into code. The TCP exercise used a client to read a text file and send its contents to a listening server on the loopback interface.

The server:

  1. accepted a connection
  2. received the document data
  3. decoded it from UTF-8
  4. counted words with split()
  5. counted non-space characters
  6. sent the two results back to the client

TCP suited the exercise because the document and response needed an ordered, reliable byte stream. It also introduced a protocol-design issue: two values sent with consecutive sendall() calls are not guaranteed to arrive as two matching recv() calls. TCP preserves byte order, not message boundaries.

A stronger version would define a response format, prefix messages with their length, read until the declared amount has arrived, and use a context manager for the file and socket.

UDP calculator

The UDP exercise used a client to collect two numbers and an operation, then sent the three values as datagrams to a server. The server decoded them, selected an arithmetic function, and returned the result.

That design exposed the difference between the two transport protocols. UDP retains datagram boundaries but does not establish a session or guarantee delivery, order, or uniqueness. The code therefore had to retain the client’s address from recvfrom() so the response could be directed back to the sender.

The four operations were implemented as separate functions:

  • addition
  • subtraction
  • multiplication
  • division

The surviving code snapshot contains mismatched client and server ports, and the response conversion and send are indented below branches that exit the loop. The design described in the submitted documentation is clear, but the archived source needs those faults corrected before it will run end to end.

What the exercises established

The Packet Tracer topology and the socket programmes worked at different scales, but they exercised the same chain:

  • choose addressing and endpoints
  • establish how data will move
  • define what each side expects
  • handle input and output
  • test the path
  • investigate where the configuration and the implementation disagree

This is early coursework, and the implementations are not production network services. They show the start of the progression into later segmentation, tunnelling, infrastructure, and security-monitoring work.