-
Notifications
You must be signed in to change notification settings - Fork 82
AddressTranslator
AddressTranslator — Click element; translates IPv6/ICMPv6, TCP, and UDP packets' addresses and ports
AddressTranslator(number_of_static_Mapping,
StaticPortMapping,N<>
StaticMapping1,...N<>
StaticMappingm,N<>
DynamicMapping,N<>
DynamicPortMapping,N<>
AddressAllocationDirection,N<>
Mapped_IP6Address Port_start Port_end)
Ports: 2 inputs, 2 outputs
Processing: agnostic
Translates IPv6/ICMPv6, TCP, and UDP packets by changing their source address, source port, destination address, and/or destination port.
Has one or more inputs and one or more outputs. Input packets must have their IP6 header annotations set. Output packets are valid IP6 packets; for instance, translated packets have their checksums updated.
AddressTranslator maintains a table of mappings for static address and port mapping and dynamic address mapping. It contains fields such as _iai, _ipi, _mai, _mpi, _ea, _ep, _t, _binding, _state, _static. For static mapping, the addresses (and ports) are mapped when the AddressTranslator is initiated. For dynamic mapping, mappings are created on the fly as new flows arrives from the direction that can be allocate new mapped address/port.
For dynamic address and port configuration, the AddressTranslator maintains two tables _in_map and _out_map to map flow ID for outward packet and inward packet respectively.
If the AddressTranslator is configured as static mapping or dynamic address mapping, when a packet arrives, the AddressTranslator will first check entries in the address-mapping * table, see if there exists an entry for the flow that the packet belongs to. If there's such an entry,then the packet's source address (and port) will be replaced with the mapped address (and port) of the entry for the outward packet and the packet's destination address (and port) will be replaced with the inner host's address (and port) for the inward packet.
If there is no such an entry and it is configured for dynamic address mapping, then the translator will create a binding for the new mapping if the flow comes from the right direction (the direction that allocates a new mapping is allowed). Otherwise, the packet is discarded.
If the AddressTranslator is configured for dynamic address and port mapping,the AddressTranslator will first check entries in the _in_map or _out_map table, depending on packet's direction. It checks if the table has an entry whose flowID is the same as the packet. If there is, use the mapped flowID of that entry for the packet. Otherwise, it will try to find an unsed port and create a mapped flowID for the flow and insert the entry, if the packet comes from the right direction.
ProtocolTranslator64, ProtocolTranslator46
Generated by click-elem2man from ../elements/ip6/addresstranslator.hh:14
on 2018/10/03.