This is an old revision of the document!


01. [10p] Implementare Hub

Vom implementa in Python funcționalitatea de baza a unui Hub. Cum am vazut si in cadrul exercitiului 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. 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.1696252992.txt.gz · Last modified: 2023/10/02 16:23 by vlad_andrei.badoiu
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