Skip to content

Fix order of packets in pcap#1595

Merged
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:pcap-packet-order
Aug 24, 2021
Merged

Fix order of packets in pcap#1595
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:pcap-packet-order

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler commented Aug 24, 2021

With the following network, the pcap showed the server 11.0.0.4 sending the SYN/ACK before receiving the SYN. The timestamps are the same for both packets, but the issue was the received packet was recorded only after it had been processed, which involved sending a new packet and recording it.

This PR fixes the order by recording the packets in the pcap earlier.

general:
  stop_time: 10
network:
  graph:
    type: gml
    inline: |
      graph [
        node [
          id 0
          host_bandwidth_down "100 Mbit"
          host_bandwidth_up "100 Mbit"
        ]
        edge [
          source 0
          target 0
          latency "500 ms"
        ]
      ]
host_defaults:
  pcap_directory: 'pcaps'
hosts:
  server:
    network_node_id: 0
    processes:
    - path: /usr/bin/python3
      args: -m http.server 80
      start_time: 3
  client:
    network_node_id: 0
    quantity: 3
    processes:
    - path: /usr/bin/curl
      args: -s server
      start_time: 5

@stevenengler stevenengler added the Component: Main Composing the core Shadow executable label Aug 24, 2021
@stevenengler stevenengler self-assigned this Aug 24, 2021
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 24, 2021

Codecov Report

Merging #1595 (d0741a8) into main (bf81601) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1595      +/-   ##
==========================================
- Coverage   54.15%   54.13%   -0.03%     
==========================================
  Files         141      141              
  Lines       18577    18577              
  Branches     4455     4455              
==========================================
- Hits        10061    10057       -4     
+ Misses       5863     5862       -1     
- Partials     2653     2658       +5     
Flag Coverage Δ
tests 54.13% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/main/host/network_interface.c 73.04% <0.00%> (ø)
src/main/core/work/event.c 66.66% <0.00%> (-1.39%) ⬇️
src/main/host/syscall/mman.c 61.36% <0.00%> (-0.76%) ⬇️
src/main/host/descriptor/descriptor.c 74.26% <0.00%> (-0.74%) ⬇️
...main/core/scheduler/scheduler_policy_host_single.c 75.00% <0.00%> (-0.68%) ⬇️
src/main/host/descriptor/socket.c 65.64% <0.00%> (-0.39%) ⬇️
src/main/host/thread_ptrace.c 50.24% <0.00%> (+0.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf81601...d0741a8. Read the comment docs.

@stevenengler stevenengler enabled auto-merge August 24, 2021 14:43
@stevenengler stevenengler merged commit b824adb into shadow:main Aug 24, 2021
@stevenengler stevenengler deleted the pcap-packet-order branch August 24, 2021 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants