-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some questions about how modules work in simlator. #3
Comments
Each qbb-net-device is a L2 device, which can be a switch OR a NIC. If it's switch, it will have a broadcom-node (m_broadcom) and a broadcom queue (m_queue) attached to it. (This is not accurate, see below) If it's a switch, upon receiving packets, it will ask m_broadcom whether there is still space for this new packet. If so, it pushes this packet into m_queue and asks m_braodcom whether the PFC threshold is met. If so, it will send a PFC PAUSE to upstream. Upon sending packets, it gets a packet from m_queue, and ask m_broadcom whether the queue length falls below PFC threshold. If so, it will send a PFC RESUME. If it's a NIC, it will perform DCQCN rate control. You can find most of these details in QbbNetDevice::Receive and QbbNetDevice::DequeueAndTransmit |
Oh, so it's very different from the switch mechanism in NS3 like bridge module , and every port of switch is also abstract , just counts how many bytes the port recveives? |
Sorry, I think I made a small mistake above. qbb-net-device is ether a NIC port or a switch port. Please bare with me... wrote these codes long ago. broadcom-node and broadcom queue is attached to the node, not the qbb-net-device. A node can have multiple qbb-net-device (especially on a switch), which share the same m_broadcom and m_queue. pg is Priority Group, some people call it priority class, or simply "priority". rpr.. stuff is from QCN standard. You can refer to http://www.cs.ucr.edu/~mart/204/802-1au-d2-4.pdf (page 96, figure 32-2) |
Thanks first. |
You are right.. they are in send(), because send() is where the packets are put into the sending queue (MMU) and ready to be sent to the next hop. This is invoked by the upper layer. The name "send" is inherited from point-to-point-device. The reason it's called "send", is because the packet is actually leaving this qbb-net-device (the ingress port). On a switch, the packet is heading towards another qbb-net-device (the egress port on the same switch). For this purpose, it must be buffered in the broadcom queue module, and waits for the egress qbb-net-device to invoke dequeueandtransmit() and get this packet. dequeueandtransmit() is where the packet actually leaves the switch. |
what you say the upper layer who invoke send() is refer to broadcom-node or broadcom queue? But i can't find where to invoke the send(). |
PFC generation is in QbbNetDevice::CheckQueueFull. QbbNetDevice::Receive handles received PFC. The implemented PFC mechanism is just standard. Once a port is paused, it either waits for a RESUME, or waits for PFC pause timeout. The send() is invoked by common NS-3 pipeline. Nothing special either. It's just overriding its parent class method PointToPointNetDevice::Send() |
It's dynamic PFC threshold from Broadcom. In DCQCN paper http://yibozhu.com/doc/dcqcn-sigcomm15.pdf, "The Trident II chipset in our switch allows us to configure a parameter β such that" The β is the m_pg_shared_alpha_cell. The paper calls it β because DCQCN already has an \alpha. Broadcom calls this value alpha. If you don't understand it and don't need it, you may disable dynamic threshold in config.txt |
The first picture you show is in udp client. It is pushing packets to the lower layer (and be buffered there), instead of actually transmitting the packet out at layer 2. Just think of what happens in real OS, when you call a socket send(), the packet is not immediately sent out. It is buffered in local OS waiting for the NIC to actually handle it. Because the simulator is testing full throughput, we keep the buffer at end host non-empty. As a result, the NIC at layer 2 will just transmit the packets at line rate, regardless the timing that UDP client sends these packets. I add random interval here just to help the case where multiple UDP flows start from the same end host. If you want to test applications that randomly send out a few packets, you need to edit application layer. Pick the right layer to work on... Keep in mind that when you see a send(), it just means sending from THIS layer to another layer (unless you are at layer 1/2). It does not mean sent out from a device. |
hi,it's nice of you to answer me every time. |
You don't need to modify anything in the code. Just edit config files. |
OK , i have try yo midify the flow.txt ,topology.txt trace.txt. |
hi |
what is "feedback_delay"? You can add link latency in topology.txt. If you want the NIC to delay sending ACKs, you can take a look at qbb-net-device, edit the place where NIC generates ACK. NP_SAMPING_INTERVAL was for modeling older (and weaker) NICs. Sometimes they cannot capture all ECN marks. For example, when they capture one ECN, they have to spend some time processing it and cannot capture another ECN within some interval. New NICs do not have this limitation. So just keep it 0. |
The trace format: The code for trace output is scattered in different xxx-header.cc files. For example, at IP layer, you can find the src_ip>dst_ip part here: https://github.com/bobzhuyb/ns3-rdma/blob/master/src/internet/model/ipv4-header.cc in Ipv4Header::Print() method If you configure a node to be traced in trace.txt, NS-3 automatically calls all headers' Print() function on every packet on this node. |
hi |
TimeStep is NS-3's data structure. You should not ask it here. Search online... Or use Visual Studio's "go to definition" or "find all references" |
hi |
total buffer = guaranteed buffer + shared buffer + headroom buffer (you can search "PFC headroom" to learn more about it) buffer_cell_limit_sp is the threshold for guaranteed + shared buffer. When the buffer is very full, and some headroom is used, this will become negative. I am sorry that I cannot send you Broadcom's confidential documents. You could directly ask them for the document of the chipset you want. |
hi |
Check qbb-net-device.cc, where these functions are called. Some of them are for NIC, some of them are for switches. Some of them use round robin (i.e., RR) to decide which priority should send the packet, some of them use strict priority. |
hi |
Check the NS-3 tracing methods, like m_phyTxEndTrace, m_snifferTrace, ... etc. in qbb-net-device.cc |
This piece of the code is controlling how the packets enter the udp sender's local buffer. Since this buffer usage can change, the time it takes for a packet to reach the first switch can vary. Please check again this answer: #3 (comment) |
Thank you for your patient reply :) |
You need to edit the wscript file of each module, e.g., https://github.com/bobzhuyb/ns3-rdma/blob/master/src/point-to-point/wscript There may also be slight differences between gcc and vc++. But it should not be hard to fix the code. The most convenient way is actually to use WINE and run exe binary directly. WINE 1.6.2 (you can install it using apt-get in Ubuntu 16.04) should work just fine. Put the binary and config files in the same folder, and run: wine64 main.exe config.txt |
oh, do you mean i still use the VS to fix and compile the source coed, and then i will get main.exe every time .Then i copy the .exe file and config file to Linux and use WINE to run ? |
Yes. |
These warnings should not matter. Have you fixed the paths of TOPOLOGY_FILE, FLOW_FILE, etc? If you put all config files in the same folder, the path should be Also, I don't know whether other WINE versions except 1.6.2 would work or not. |
I change the path of the TOPOLOGY_FILE,etc , and it seems work well. |
You need to add the files that were not in the original NS-3 version to wscript. This is more of an NS-3 problem. You can search questions like "how to add a new module to NS-3" online. I haven't compiled it in Linux for years. So you are pretty much on your own. |
OK, i will try and maybe i can write some guide for how to run the project on Linux. |
You can lower the threshold, but be careful it's related to link delay. If it's too low, PFC will still drop packets. Because I never run that many ports and priorities, it did not matter for me. This is what happens in reality -- the number of lossless priorities is very limited in practice due to lack of buffer! |
hi Thank you! |
These are data structures that help track some internal states in the NICs/switches. You can read the meanings from the names. "f" means flow, "q" means queue. e.g., findex is flow index. fcount is flow count. rrlast is the last queue in round robin scheduler. qlast is the last queue. |
hi |
There is no particular reason. The config.txt is just an example. You can edit it to make it consistent with the paper, or try your own parameters. |
Thank you for your reply. |
inDev is the ingress port, ifindex is the egress port. m_usedEgressSPBytes[GetEgressSP(indev, qIndex)] is Service Pool (SP) buffer usage. This is some Broadcom stuff. |
hi |
hi |
You can add static routes to the routers. https://www.nsnam.org/doxygen/classns3_1_1_ipv4_static_routing.html |
Hi.
I have run the main.exe correctly and now i want to implement some algorithm on simulator.
Can i know how the simulator work , like the relationship of qbb-device and broadcom-node, and the role of qbb-device in simulation.
I also want to know where and who decides when to send PFC packet.
Thank you for your reply
The text was updated successfully, but these errors were encountered: