|
Switches can be connected in many different topologies. We start with a chain topology of two hosts and four switches in the network, as shown in Figure at the top
The host is the starting point for a packet. Each packet in the packet starts with the address of the origin and the address of the destination. The host checks the packet reception, transmission, and transmission possibilities. The functions used for host modeling are host_init(), check_recv_packet(), check_send_packet(), recv_update(), and send_packet(), shown in Figure below. The function host_init() initializes the host. The function check_recv_packet() checks whether the host receives a packet. The function recv_update() initializes after receiving a packet from the host. The function send_packet() sends a packet from the host and randomly selects 3 or 4 as the DST (destination)
|