01. [15p] Implementare Hub

Vom implementa in Python funcționalitatea de baza a unui Hub. Cum am vazut si in cadrul laboratorului anterior, pentru fiecare frame primit, hub-ul îl trimite pe toate interfețele (link sau port). Mai jos gasim o descriere in pseudocod:

while hub is powered on:
    for each port:
        if there is incoming data:
            read the incoming data
            for each other port:
                send the data to that port

In acest exercițiu vom implementa un Hub in Python pornind de la un API simplu de primire si trimitere de frame-uri Ethernet. Vom porni de la scheletul de la urmatoarea adresa. Tot acolo, gasiti in README.md detalii despre rularea scheletului. Implementarea se va face in hub.py, in dreptul celor doua TODO-uri.

# data este de tip byte array
interface, data, length = recv_from_any_link()
send_to_link(interface, data, length)
rl/labs/02/contents/01.txt · Last modified: 2023/10/17 10:51 by vlad_iulius.nastase
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0