networking

I would like to check physical ports redunducy check with python

I would like to check physical ports redunducy check with python Question: would like to check physical network ports with python scripts ports information as following, Python scripts can check if ServerID has 2 or more physical network lines to differents network devices. ServerID,NetworkID,Port name Server_1,NW_1,ge-0/0/8 Server_2,NW_2,ge-0/0/5 Server_3,NW_3,Ethernet7/15 Server_4,NW4,ae4 Server_4,NW4,ge-2/2/0 Server_4,NW4,ge-2/2/1 Server_4,NW4,ge-2/2/2 Server_4,NW4,ge-2/3/0 Server_4,NW4,ge-2/3/1 Server_10,NW5,ae4 …

Total answers: 2

Total bytes for each IPs in the dataset using pandas

Total bytes for each IPs in the dataset using pandas Question: df.value_counts(subset=’DstAddr’, ascending=False) df.head() I am trying to find a way to show for each unique IP: How many in the sum of total bytes does it have? For example, if I want to find all dataset: df[‘TotBytes’].sum() But I want to find for each …

Total answers: 1

Python Socket accept() Timeout

Python Socket accept() Timeout Question: Using sockets, the below Python code opens a port and waits for a connection. Then, it sends a response when a connection is made. import socket ip = 127.0.0.1 port = 80 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((ip, port)) s.listen(1) conn, addr = s.accept() conn.send(response) conn.close() If a …

Total answers: 2

How to convert to MB or KB the pandas describe table?

How to convert to MB or KB the pandas describe table? Question: df.describe() I have a network dataset. To be able to understand the dataset better, I want to find a way to convert the numbers to MB or KB for packets and bytes. df.head() Asked By: linuxpanther || Source Answers: You could just divide …

Total answers: 1

Socket freezes while connecting (socket.connect())

Socket freezes while connecting (socket.connect()) Question: I am attempting to create a subnet scanner in python. The first part of the code takes input from a user and finds the subnet based on the input. The second part takes the subnet and goes through all 255 hosts. The problem is, the code freezes when it …

Total answers: 2

Pyspark mapInPandas failing intermittently with timeout/connection errors

Pyspark mapInPandas failing intermittently with timeout/connection errors Question: I am running into intermittent timeout and "Python worker failed to connect back" errors when using mapInPandas, reproduced by the following script. If I run this script several times in succession it will sometimes even alternate between working and failing. Other times it will fail repeatedly. # …

Total answers: 1

How can I send my file to another network?

How can I send my file to another network? Question: I can’t find a way to send a file over to another network. I have a file that I want to send to a different computer which is not on the same network. Right now I’m using a server and a client side. Here is …

Total answers: 1

DNS Packet IP Address Structure

DNS Packet IP Address Structure Question: I have been writing a python program that builds a packet and sends a reverse DNS lookup request to a DNS server. I have a problem the IP address is stored in hex in a way that is difficult to understand. In the hex field it has the number …

Total answers: 2

Cannot connect to remote Database instance from my docker container, however can connect from my host computer

Cannot connect to remote Database instance from my docker container, however can connect from my host computer Question: I have a problem connecting to remote database instances from a docker container. I have a Docker container with a simple piece of Python code that connects to a remote MongoDB instance client = MongoClient(‘mongodb-example_conn_string.com’) db = …

Total answers: 2

What is `conn, addr = s.accept()` in python socket?

What is `conn, addr = s.accept()` in python socket? Question: I searched documentations and tutorials but no one talked about this, for example this is server script import socket server = socket.socket() print("socket created") server.bind(("localhost", 9999)) server.listen(3) print("waiting for connection") while True: client, addr = server.accept() print(client) print(addr) name = client.recv(1024).decode() print("connected with", addr, client, …

Total answers: 4