ntop / n2disk

Open source components and extensions for n2disk
503 stars 11 forks source link

Multiple n2disk instances are not separated from each other #42

Closed RezaMohammadi99 closed 3 years ago

RezaMohammadi99 commented 3 years ago

I am trying to write a bash script to run multiple instances of n2disk, trying to bind one port to each file system. I have two napatech NICs with two 40G ports each, and four drives. The four ports are called ntxs0, ntxs1, ntxs2, ntxs3 and my storage drives are named storage0, storage1, storage2, storage3. I would like to save all the data coming into port ntxs0 to be saved in storage0, all the data in ntxs1 to be saved in storage1, and so on. I have provided the commands my script runs below, when I run it the data from all four ports are scattered between the four filesystems. I.E the pcap files that are saved in the filesystems all contain packets from all four ports. Why is this happening? I thought I could bind each port to a filesystem.

sudo n2disk -i $SFP_PORT_A -o $SFP_PORT_A_STORAGE -s $PACKET_SIZE -p $MAX_FILE_LENGTH -b $BUFFER_LENGTH -q $POLL_DURATION -C $CHUNK_LENGTH -S 0 -c 1 -w 2 sudo n2disk -i $SFP_PORT_B -o $SFP_PORT_B_STORAGE -s $PACKET_SIZE -p $MAX_FILE_LENGTH -b $BUFFER_LENGTH -q $POLL_DURATION -C $CHUNK_LENGTH -S 3 -c 4 -w 5 sudo n2disk -i $SFP_PORT_C -o $SFP_PORT_C_STORAGE -s $PACKET_SIZE -p $MAX_FILE_LENGTH -b $BUFFER_LENGTH -q $POLL_DURATION -C $CHUNK_LENGTH -S 6 -c 7 -w 8 sudo n2disk -i $SFP_PORT_D -o $SFP_PORT_D_STORAGE -s $PACKET_SIZE -p $MAX_FILE_LENGTH -b $BUFFER_LENGTH -q $POLL_DURATION -C $CHUNK_LENGTH -S 9 -c 10 -w 11

cardigliano commented 3 years ago

@RezaMohammadi99 napatech ports are usually named using the port ID, how did you configure ntxs0? You should specify nt:X (where X is the port ID) as interface name.

RezaMohammadi99 commented 3 years ago

I configured my napatech ports using the osmode function in the napatech tools suite. Why would this cause the problem? Shouldn't each port be considered individually anyway?

cardigliano commented 3 years ago

@RezaMohammadi99 yes in any case each port should be considered individually, since they should be standard interfaces, you should be able to check the behaviur with other tools like tcpdump, and check with Napatech the osmode configuration. Btw, I suggest to use the native mode as otherwise your capture performance are limited.