protected class Router.OutputPort
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) double |
maxMismatchRatio
Mismatch ratio of transmission speeds between the input and
output links of this router.
|
(package private) double |
mismatchCount
Counts how many packets to receive before one can be sent
if the outgoing link is slower than incoming links.
Different increments may be associated with different incoming links. |
(package private) Link |
outgoingLink
The outgoing link associated with this output port.
|
(package private) Packet |
packetInTransmission
Holds the packet currently in transmission on the
outgoing link.
|
Constructor and Description |
---|
Router.OutputPort(Link outgoingLink_)
Constructor for the inner class.
|
Modifier and Type | Method and Description |
---|---|
protected double |
calculateMismatchRatio(Link incomingLink_)
Helper method to calculate the mismatch ratio of an
incoming and the outgoing link as:
|
(package private) void |
handleIncomingPacket(NetworkElement source_,
Packet receivedPacket_)
Handles an incoming packet that is heading out on this
output port.
|
(package private) void |
transmitPackets()
Transmits packets on the outgoing link.
|
(package private) void |
updateMaxMismatchRatios(java.util.Collection<Link> allLinks_)
Calculates the maximum mismatch ratio for the associated
outgoing link relative to all other (incoming) links.
|
double maxMismatchRatio
1.0
),
meaning that packets simply pass through the router without buffering.double mismatchCount
Link outgoingLink
Packet packetInTransmission
Router.OutputPort(Link outgoingLink_)
outgoingLink_
- the outgoing link with which this output port will be associatedprotected double calculateMismatchRatio(Link incomingLink_)
outgoingLinkTransmissionTime / incomingLinkTransmissionTime
incomingLink_
- incoming link to compare tovoid handleIncomingPacket(NetworkElement source_, Packet receivedPacket_)
source_
- the communication link through which the packet arrivedreceivedPacket_
- the packet that arrived on an incoming linkvoid transmitPackets()
Router.process(int)
void updateMaxMismatchRatios(java.util.Collection<Link> allLinks_)
allLinks_
- the list of all other incoming links