Skip to content

Ethernet

feral3gp.feral.ethernet(config, director=Simulation.director_de)

Source code in feral3gp/feral/network/eth.py
77
78
79
80
81
82
83
84
85
86
87
88
def ethernet(config: ETHConfig, director=Simulation.director_de):
    number_of_nodes = len(config.nodes)
    network = JSwitchedEthernetNetwork(config.name, director, number_of_nodes)
    network.setBitRate(config.bit_rate)
    __configure_promiscuous_mode(network, config.promiscuous_mode)
    network.setLogTransmissions(config.log_transmissions)
    network.setLogHexadecimalValues(config.hexadecimal_payload_logging)

    __configure_nodes(config, network, __configure_eth_node)
    __configure_console(network, config.console)

    return network

feral3gp.feral.ETHConfig dataclass

Bases: NetworkConfig

The configuration of the Ethernet network

Source code in feral3gp/feral/network/eth_config.py
36
37
38
39
40
41
42
43
44
45
@dataclass
class ETHConfig(NetworkConfig):
    """
    The configuration of the Ethernet network
    """

    promiscuous_mode: bool = False
    """
    Enable or disable promiscuous mode
    """

promiscuous_mode: bool = False class-attribute instance-attribute

Enable or disable promiscuous mode

feral3gp.feral.ETHNodeConfig dataclass

Bases: NodeConfig

Data class to configure the behaviour of an ethernet node

Source code in feral3gp/feral/network/eth_config.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@dataclass
class ETHNodeConfig(NodeConfig):
    """
    Data class to configure the behaviour of an ethernet node
    """

    promiscuous_mode: bool = False
    """This property name is used to change promiscuous mode. When in promiscuous mode, MAC filtering is disabled."""

    multicast_processing: bool = False
    """This property is used to define the process multicast frames of this interface. It process the multicast frames 
    which are added to the list of 'accepted_multicast_ids'."""

    accepted_multicast_ids: typing.List[str] = None
    """This property name is used to define the accepted Multicast IDs of this interface."""

    vlan_filtering: bool = None
    """This property name is used to enable/disable the flag to filter VLAN tags. VLAN tags which shall be accepted 
    have to be defined in 'accepted_vlan_tags'."""

    accepted_vlan_tags: typing.List[int] = None
    """This property name is used to define the accepted VLAN tags for this interface. This is only processed when 
    'vlan_filtering' is true."""

    address: str = None
    """the address of the node. Only relevant, if the node is a RAW interface. Otherwise the address will be 
    specified within the 'MessageTypeConfiguration'"""

accepted_multicast_ids: typing.List[str] = None class-attribute instance-attribute

This property name is used to define the accepted Multicast IDs of this interface.

accepted_vlan_tags: typing.List[int] = None class-attribute instance-attribute

This property name is used to define the accepted VLAN tags for this interface. This is only processed when 'vlan_filtering' is true.

address: str = None class-attribute instance-attribute

the address of the node. Only relevant, if the node is a RAW interface. Otherwise the address will be specified within the 'MessageTypeConfiguration'

multicast_processing: bool = False class-attribute instance-attribute

This property is used to define the process multicast frames of this interface. It process the multicast frames which are added to the list of 'accepted_multicast_ids'.

promiscuous_mode: bool = False class-attribute instance-attribute

This property name is used to change promiscuous mode. When in promiscuous mode, MAC filtering is disabled.

vlan_filtering: bool = None class-attribute instance-attribute

This property name is used to enable/disable the flag to filter VLAN tags. VLAN tags which shall be accepted have to be defined in 'accepted_vlan_tags'.