Repository navigation
Index out of range during emulation #24
Description
Activity
Looks like the problem of ifconfig command. Is ifconfig or package net-tools installed on the remote machine?
Yes ifconfig and net-tools and iperf, and iperf3 are installed on the remote machine.
$ ifconfig --version
net-tools 2.10
I did a bit more digging but have not been able to resolve this issue. I have modified the sn_ping function in sn_utils.py to print out the commands it is going to run before it runs them.
def sn_ping(src, des, time_index, constellation_size, container_id_list,
file_path, configuration_file_path, remote_ssh):
print(f"container id list {container_id_list}")
print(f"src {src} des {des}")
**print(f"src {container_id_list[src - 1]} des {container_id_list[des - 1]}")**
des_IP = []
if des <= constellation_size:
**print(f"ifconfig_output_command= docker exec -it {container_id_list[des - 1]} ifconfig | sed 's/[ \t].*//;/^\(eth0\|\)\(lo\|\)$/d'")**
ifconfig_output = sn_remote_cmd(
remote_ssh, "docker exec -it " + str(container_id_list[des - 1]) +
" ifconfig | sed 's/[ \t].*//;/^\(eth0\|\)\(lo\|\)$/d'")
**print(f"ifconfig_output {ifconfig_output}")**
des_IP = sn_remote_cmd(
remote_ssh, "docker exec -it " + str(container_id_list[des - 1]) +
" ifconfig " + ifconfig_output[0][:-1] +
"|awk -F '[ :]+' 'NR==2{print $4}'")
print(f"des_IP {des_IP}")
else:
des_IP = sn_remote_cmd(
remote_ssh, "docker exec -it " + str(container_id_list[des - 1]) +
" ifconfig B" + str(des) +
"-default |awk -F '[ :]+' 'NR==2{print $4}'")
**print(f"des_IP ELSE {des_IP}")**
ping_result = sn_remote_cmd(
remote_ssh, "docker exec -i " + str(container_id_list[src - 1]) +
" ping " + str(des_IP[0][:-1]) + " -c 4 -i 0.01 ")
f = open(
configuration_file_path + "/" + file_path + "/ping-" + str(src) + "-" +
str(des) + "_" + str(time_index) + ".txt", "w")
f.writelines(ping_result)
f.close()
Modifying the sn_ping with some debug statements, this is what I see:
src 0ebfacbbfd03 des 6f205da00e9b
ifconfig_output_command= docker exec -it 6f205da00e9b ifconfig | sed 's/[ ].*//;/^\(eth0\|\)\(lo\|\)$/d'
ifconfig_output ['\r\n', '\r\n']
des_IP []
Then running these commands in my remote server this is what I see:
$ sudo docker exec -it 6f205da00e9b ifconfig | sed 's/[ \t].*//;/^\(eth0\|\)\(lo\|\)$/d'
if I run it without the regex I am getting a result
$ sudo docker exec -it 6f205da00e9b ifconfig
eth0 Link encap:Ethernet HWaddr 22:7c:31:bf:d7:c4
inet addr:172.17.0.19 Bcast:172.17.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:218 errors:0 dropped:0 overruns:0 frame:0
TX packets:138 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:17064 (17.0 KB) TX bytes:13096 (13.0 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
The links with names like B1-eth6 don't seem to be established.
Could you check the docker network configurations? Here is an output example.
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
59f0e91119e2 GSL_7-26 bridge local
47a65ded2fa5 GSL_13-27 bridge local
2a379334c5e6 GS_26 bridge local
a8e1232e2bc8 GS_27 bridge local
d11cc0d92e32 La_0-0_0-1 bridge local
6eb419bc095c La_0-1_0-2 bridge local
606fdf23b898 La_0-2_0-3 bridge local
c2f3fbc8618a La_0-3_0-4 bridge local
...
I am not seeing the bridge on the remote machine
$ docker network ls
NETWORK ID NAME DRIVER SCOPE
7dd94570d608 bridge bridge local
a031f596fddf docker_gwbridge bridge local
0157ecfcc7ce host host local
n7ejuky1dfot ingress overlay swarm
6bc53d22dfab none null local
$ sudo docker network inspect docker_gwbridge
[
{
"Name": "docker_gwbridge",
"Id": "703c27f4fc6d4d83127ea24fdc7c9c2b2fdc0ff8a1cd7168a7f7129a1781854f",
"Created": "2025-04-10T04:04:28.694975658Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv4": true,
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"ingress-sbox": {
"Name": "gateway_ingress-sbox",
"EndpointID": "a36be0f58c4168f3d60d4b54e3c06c8201aa758d86693dc675bc60ce9dc37603",
"MacAddress": "d2:f7:20:e7:e7:74",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.bridge.enable_icc": "false",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.name": "docker_gwbridge"
},
"Labels": {}
}
]
remote machine docker containers
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4025eff5700f lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_1
c4b1c02b7693 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_2
a85a912a0125 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_3
f5ffc2dca6fe lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_4
3b8ab3aba4b3 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_5
5344a663f6a4 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_6
60befa821cdc lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_7
b754d29034bd lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_8
47d56688b84b lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_9
b481e99162a2 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_10
35c004cb39b3 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_11
8e391cb51ce4 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_12
9094a7d090db lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_13
3689bc1b8350 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_14
1f1f44730c2f lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_15
ed090632d4a2 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_16
fb2a1330f70b lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_17
44d6cf7e68e1 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_18
18d19c48bf4c lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_19
c9e60a816ba0 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_20
9f01f975f972 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_21
8be043318d2f lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_22
14285e62430e lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_23
7e893e98767c lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_24
d7e6ad0c4067 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_25
af73bcdfa94e lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_26
e64f1bfa0e77 lwsen/starlab_node:1.0 "ping www.baidu.com" 19 seconds ago Up 18 seconds 9999/tcp ovs_container_27
this remote machine should init a docker swarm correct?
like
docker swarm init
Yes, the remote machine needs to initialize a docker swarm first.
I also have the exact problem even after initialization of docker swarm, have you solved the issue?
I have built and installed StarryNet as instructed, and I am seeing these errors when I run the example.
Why is this bug happening? is this an issue with my configuration or with docker or with the code base?