I'm working with omnet++ 6.0 and INET 4.3 and met a runtime error related with PacketGate-Scheduler module.
In the simulation configuration, two Ethernet hosts(inet/node/ethernet/EthernetHost2.ned) are connected with an Ethernet switch(inet/node/EthernetSwitch.ned). For queue of EthernetMAC(inet/linklayer/ethernet/basic/), a submodule of EthernetInterface(inet/linklayer/ethernet/) module of the EthernetSwitch, EthernetQoSQueue(inet/linklayer/ethernet/common/) module is used first. This EthernetQoSQueue consists of classifier-queue-scheduler. In this case there is no problem.
The configuration is as follows. hdc_switch is identical to the EthernetSwitch except some parameter.
import inet.node.ethernet.EthernetHost2; import inet.node.ethernet.EthernetSwitch; import ned.DatarateChannel; network hdc { types: channel ethernetline extends DatarateChannel { parameters: delay = 0.1us; datarate = 1Gbps; } submodules: hostA: EthernetHost2 { parameters: @display("p=250,100"); } hostB: EthernetHost2 { parameters: @display("p=401,233"); } switch: hdc_switch { //EthernetSwitch { parameters: @display("p=250,200"); gates: ethg[2]; // @loose; } connections: switch.ethg[0] <--> ethernetline <--> hostA.ethg; switch.ethg[1] <--> ethernetline <--> hostB.ethg; }
Later I added a gate submodule (inet/queueing/gate/PacketGate.ned) to the EthernetQoSQueue which becomes a kind of GatingPriorityQueue(inet/queueing/queue/). The PacketGate is set with always-on state being maintained from the simulation start.
Without the gate module, the simulation runs without problem. But with gate module added, the simulation stops with runtime error. Simulation log below shows that the first packet pk-9-1 passes the GatingPriorityQueue module successfully. But before a next packet arrives and is processed by submodules (such as relay module ..) of the switch, the scheduler of the GatingPriorityQueue tries to pull a packet from the gate submodule too early and aborts with run time error since there is yet no packet to pass the gate submodule.
Below is the part of the simulation log messages. Some log messages are added to default scheduler log messages. In the upper part of the log messages, we can see that the first packet pk-9-1 passes Classifier and inserted to Queue, and then Scheduler checks the Queue. However, the last part of the log messages shows that with no packet passing Classifier and going into Queue, but Scheduler checking the Queue is called resulting in the error.
It seems that this error is due to the fact the PacketSchedulerBase::pullPacket() is called when the packet source (queue) is empty. Then the question is how to guarantee that the pullPacket() is called only when the packet source is not empty.
INFO:Processing packet from network, incomingInterface = eth0 ID:100 MTU:1500 UP BROADCAST CARRIER MULTICAST macAddr:0A-AA-00-00-00-03, incomingPacket = (Packet)pk-9-1 (1287 B) [EthernetPhyHeader | EthernetMacHeader, typeOrLength = 1269 | Ieee8022LlcHeader, dsap = -1, ssap = -1, control = 3 | ByteCountChunk, length = 1266 B, data = 63 | EthernetFcs, fcs = 3222126605, fcsMode = 1 (FCS_DECLARED_CORRECT)]. INFO:Learning peer address, sourceAddress = 0A-AA-00-00-00-01, incomingInterface = eth0 ID:100 MTU:1500 UP BROADCAST CARRIER MULTICAST macAddr:0A-AA-00-00-00-03. INFO (MacAddressTable)hdc.switch.macTable:Adding entry to Address Table: 0A-AA-00-00-00-01 --> interfaceId 100 INFO:Broadcasting packet to all interfaces except incoming interface, destinationAddress = 0A-AA-00-00-00-02, incomingInterface = eth0 ID:100 MTU:1500 UP BROADCAST CARRIER MULTICAST macAddr:0A-AA-00-00-00-03, outgoingPacket = (Packet)pk-9-1 (1287 B) [EthernetMacHeader, typeOrLength = 1269 | Ieee8022LlcHeader, dsap = -1, ssap = -1, control = 3 | ByteCountChunk, length = 1266 B, data = 63 | EthernetFcs, fcs = 3222126605, fcsMode = 1 (FCS_DECLARED_CORRECT)]. INFO:Sending packet to peer, destinationAddress = 0A-AA-00-00-00-02, outgoingInterface = eth1 ID:101 MTU:1500 UP BROADCAST CARRIER MULTICAST macAddr:0A-AA-00-00-00-04, packet = (Packet)pk-9-1 (1287 B) [EthernetMacHeader, typeOrLength = 1269 | Ieee8022LlcHeader, dsap = -1, ssap = -1, control = 3 | ByteCountChunk, length = 1266 B, data = 63 | EthernetFcs, fcs = 3222126605, fcsMode = 1 (FCS_DECLARED_CORRECT)]. ** Event #9 t=0.007969205046 hdc.switch.eth[1].mac (EthernetMac, id=63) on pk-9-1 (inet::Packet, id=50) INFO:Received (inet::Packet)pk-9-1 (1287 B) (inet::SequenceChunk) length = 1287 B from upper layer. DETAIL:Frame (inet::Packet)pk-9-1 (1287 B) (inet::SequenceChunk) length = 1287 B arrived from higher layer, enqueueing INFO (SimpleClassifier)hdc.switch.eth[1].mac.queue.classifier:Classifying packet, packet = (Packet)pk-9-1 (1287 B) [EthernetMacHeader, typeOrLength = 1269 | Ieee8022LlcHeader, dsap = -1, ssap = -1, control = 3 | ByteCountChunk, length = 1266 B, data = 63 | EthernetFcs, fcs = 3222126605, fcsMode = 1 (FCS_DECLARED_CORRECT)]. INFO (PacketQueue)hdc.switch.eth[1].mac.queue.queue[0]:Pushing packet, packet = (Packet)pk-9-1 (1287 B) [EthernetMacHeader, typeOrLength = 1269 | Ieee8022LlcHeader, dsap = -1, ssap = -1, control = 3 | ByteCountChunk, length = 1266 B, data = 63 | EthernetFcs, fcs = 3222126605, fcsMode = 1 (FCS_DECLARED_CORRECT)]. INFO (PriorityBuffer)hdc.switch.eth[1].mac.queue.buffer:Adding packet, packet = (Packet)pk-9-1 (1287 B) [EthernetMacHeader, typeOrLength = 1269 | Ieee8022LlcHeader, dsap = -1, ssap = -1, control = 3 | ByteCountChunk, length = 1266 B, data = 63 | EthernetFcs, fcs = 3222126605, fcsMode = 1 (FCS_DECLARED_CORRECT)]. INFO (PriorityScheduler)hdc.switch.eth[1].mac.queue.scheduler: PacketSchedulerBase::handleCanPullPacketChanged() with callSchedulePacket() PacketSchedulerBase::pullPacket() with callSchedulePacket() INFO (PriorityScheduler)hdc.switch.eth[1].mac.queue.scheduler: !! 1 PacketSchedulerBase::callSchedulePacket() executed !! !!!!PriorityScheduler::schedulePacket(), providers size is 1 !!!!!!! inputIndex = 0 inProgressGateIndex = -1 canPullSomePacket value is 1 INFO (PacketQueue)hdc.switch.eth[1].mac.queue.queue[0]: !! 2 PacketSchedulerBase::callSchedulePacket() executed !! Pulling packet, packet = (Packet)pk-9-1 (1287 B) [EthernetMacHeader, typeOrLength = 1269 | Ieee8022LlcHeader, dsap = -1, ssap = -1, control = 3 | ByteCountChunk, length = 1266 B, data = 63 | EthernetFcs, fcs = 3222126605, fcsMode = 1 (FCS_DECLARED_CORRECT)]. INFO (PriorityBuffer)hdc.switch.eth[1].mac.queue.buffer:Removing packet, packet = (Packet)pk-9-1 (1287 B) [EthernetMacHeader, typeOrLength = 1269 | Ieee8022LlcHeader, dsap = -1, ssap = -1, control = 3 | ByteCountChunk, length = 1266 B, data = 63 | EthernetFcs, fcs = 3222126605, fcsMode = 1 (FCS_DECLARED_CORRECT)]. INFO (PacketGate)hdc.switch.eth[1].mac.queue.gate[0]:Passing through packet, packet = (Packet)pk-9-1 (1287 B) [EthernetMacHeader, typeOrLength = 1269 | Ieee8022LlcHeader, dsap = -1, ssap = -1, control = 3 | ByteCountChunk, length = 1266 B, data = 63 | EthernetFcs, fcs = 3222126605, fcsMode = 1 (FCS_DECLARED_CORRECT)]. INFO (PriorityScheduler)hdc.switch.eth[1].mac.queue.scheduler:PacketSchedulerBase::pullPacket, Scheduling packet, packet = (Packet)pk-9-1 (1287 B) [EthernetMacHeader, typeOrLength = 1269 | Ieee8022LlcHeader, dsap = -1, ssap = -1, control = 3 | ByteCountChunk, length = 1266 B, data = 63 | EthernetFcs, fcs = 3222126605, fcsMode = 1 (FCS_DECLARED_CORRECT)]. DETAIL:Transmitting a copy of frame (inet::Packet)pk-9-1 (1287 B) (inet::SequenceChunk) length = 1287 B INFO:Transmission of (inet::Packet)pk-9-1 (1295 B) (inet::SequenceChunk) length = 1295 B started. ** Event #10 t=0.007979565046 hdc.switch.eth[1].mac (EthernetMac, id=63) on selfmsg EndTransmission (omnetpp::cMessage, id=36) INFO:Transmission of (inet::Packet)pk-9-1 (1287 B) (inet::SequenceChunk) length = 1287 B successfully completed. DETAIL:Start IFG period ** Event #11 t=0.007979661046 hdc.switch.eth[1].mac (EthernetMac, id=63) on selfmsg EndIFG (omnetpp::cMessage, id=37) DETAIL:IFG elapsed INFO (PriorityScheduler)hdc.switch.eth[1].mac.queue.scheduler: PacketSchedulerBase::pullPacket() with callSchedulePacket() INFO (PriorityScheduler)hdc.switch.eth[1].mac.queue.scheduler: !! 1 PacketSchedulerBase::callSchedulePacket() executed !! !!!!PriorityScheduler::schedulePacket(), providers size is 1 !!!!!!! inputIndex = 0 inProgressGateIndex = -1 canPullSomePacket value is 0 <!> PacketSchedulerBase::callSchedulePacket(), Scheduled packet from invalid input gate: -1 with inputGates_size = 1 -- in module (inet::queueing::PriorityScheduler) hdc.switch.eth[1].mac.queue.scheduler (id=73), at t=0.007979661046s, event #11
https://stackoverflow.com/questions/66072399/runtime-error-in-queue-with-gate-for-mac-in-ethernetswitch-of-omnet-inet-model February 06, 2021 at 08:29AM
没有评论:
发表评论