mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Linux

Reply
 
Thread Tools
Old 2018-09-17, 17:09   #12
SELROC
 

628610 Posts
Default

Quote:
Originally Posted by chalsall View Post
If I may, just drilling down on the premise of your code (being able to detect noise on a link), I'm not sure that your code can accomplish this.

When I try to do this kind of thing from one end, I do flood pinging (ICMP). If I have control of both ends of the connection I use UDP packets. But this only tells me packet loss, it doesn't give me any data with regards to noise nor attenuation, etc. Usually I get this kind of thing via SNMP messages from the devices (but, obviously, only if I have control of them).

Not trying to discourage you, but I'd be very interested if you have figured out a way to collect such data using only "sniffing the wire" at Layer 2.



You might be interested in this probably:


https://github.com/valeriob01/fcs-control
  Reply With Quote
Old 2018-09-18, 08:31   #13
Nick
 
Nick's Avatar
 
Dec 2012
The Netherlands

170210 Posts
Default

Quote:
Originally Posted by SELROC View Post
Even worse, the crc checking is sometimes off-loaded to hardware (NIC), in this case the only possible thing to do is modify the NIC bios.
You would have to decide precisely how you define a "bad frame".
Which frames are so bad that they no longer count as frames (for you), and does your definition agree with what the hardware & driver do?
Nick is online now   Reply With Quote
Old 2018-09-18, 08:35   #14
SELROC
 

2×29×67 Posts
Default

Quote:
Originally Posted by Nick View Post
You would have to decide precisely how you define a "bad frame".
Which frames are so bad that they no longer count as frames (for you), and does your definition agree with what the hardware & driver do?

hello, usually a bad frame is one which has a wrong CRC at the end. If you know other parameters to identify a bad frame please let me know.
  Reply With Quote
Old 2018-09-18, 09:08   #15
Nick
 
Nick's Avatar
 
Dec 2012
The Netherlands

170210 Posts
Default

Quote:
Originally Posted by SELROC View Post
hello, usually a bad frame is one which has a wrong CRC at the end. If you know other parameters to identify a bad frame please let me know.
Runts (i.e. frames shorter than the minimum length), jabbers (frames longer than the maximum length), misaligned frames (number of bits is not a multiple of 8), ....
Nick is online now   Reply With Quote
Old 2018-09-18, 09:30   #16
SELROC
 

751 Posts
Default

Quote:
Originally Posted by Nick View Post
Runts (i.e. frames shorter than the minimum length), jabbers (frames longer than the maximum length), misaligned frames (number of bits is not a multiple of 8), ....



I'm not sure and I should read some documentation. Generally it should be like this: short frames are padded up to minimum length. There is the notion of jumbo frame so it is not so evident what is a jabber.


misaligned frames should be dropped in theory.
  Reply With Quote
Old 2018-09-21, 10:38   #17
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

100101100010112 Posts
Default

If you ask me, I would drop all frames which are not "perfect". No padding, no cutting, no passing over to somebody else, like "I_don't_know_what_to_make_of_it,_but_I_give_it_to_you_maybe_you_can_sort_it_out"-frame. These are bad, just discard/scrap them. No trying fixing it, either. You may have issues talking with, or understanding some other entities in your universe, but on the other hand, any message jumping from one component to another inside of your box consumes time and resources, and it helps my DoS attach. I can serve you a bunch of bad frames on purpose and you will lose few centuries trying to decode them, or passing them around hoping (or hopping?) that "some guy in your organization" can decode them.

Real life: years ago we developed some parts for an ATM machine for a French customer. The "development" was more like copying the functionality of an existent product, due to non-availability of the components - the original design was done in the nineties, and most parts were end-of-life and difficult to get. The device contained a bridge between two protocols, i.e. beside of sending stuff to both ends it was connected to, it could also take strings from one side and pass them to the other side, converted to right format, if the strings were not addressed to the device itself, in which case they would be parsed, executed, whatever. The design being so old and EOL, the customer had not many specs and gave us real devices to "hack". I did part of the hacking, and all the software. I did the communication my own way. Keeping the compatibility, but still my own way. The product was a success (we are still producing it), but for a while they used both suppliers (us, and the original supplier). Then, they extended to US market, and with this, some more rigorous testing. Guess what, the original design didn't pass the tests - the whole machine could be easily locked with some radio beams. We are now the only supplier.

On the other hand, if you make a sniffer... (i.e. you may want to keep everything, for analysis...)

Last fiddled with by LaurV on 2018-09-21 at 10:41
LaurV is offline   Reply With Quote
Old 2018-09-21, 11:12   #18
SELROC
 

3·72·53 Posts
Default

Quote:
Originally Posted by LaurV View Post
If you ask me, I would drop all frames which are not "perfect". No padding, no cutting, no passing over to somebody else, like "I_don't_know_what_to_make_of_it,_but_I_give_it_to_you_maybe_you_can_sort_it_out"-frame. These are bad, just discard/scrap them. No trying fixing it, either. You may have issues talking with, or understanding some other entities in your universe, but on the other hand, any message jumping from one component to another inside of your box consumes time and resources, and it helps my DoS attach. I can serve you a bunch of bad frames on purpose and you will lose few centuries trying to decode them, or passing them around hoping (or hopping?) that "some guy in your organization" can decode them.

Real life: years ago we developed some parts for an ATM machine for a French customer. The "development" was more like copying the functionality of an existent product, due to non-availability of the components - the original design was done in the nineties, and most parts were end-of-life and difficult to get. The device contained a bridge between two protocols, i.e. beside of sending stuff to both ends it was connected to, it could also take strings from one side and pass them to the other side, converted to right format, if the strings were not addressed to the device itself, in which case they would be parsed, executed, whatever. The design being so old and EOL, the customer had not many specs and gave us real devices to "hack". I did part of the hacking, and all the software. I did the communication my own way. Keeping the compatibility, but still my own way. The product was a success (we are still producing it), but for a while they used both suppliers (us, and the original supplier). Then, they extended to US market, and with this, some more rigorous testing. Guess what, the original design didn't pass the tests - the whole machine could be easily locked with some radio beams. We are now the only supplier.

On the other hand, if you make a sniffer... (i.e. you may want to keep everything, for analysis...)

I got a sense on how to do NIC options manipulation with the "ethtool" program. If ethtool does its job well, it is possible to use an option to manipulate NIC flags, with it I can set the various off-loads to off, and with the rx-fcs option I can switch off crc checking (in theory).


On the other hand I am still searching a C library that lets me read unconditioned ethernet frames.
  Reply With Quote
Old 2018-09-21, 14:00   #19
SELROC
 

11000000011002 Posts
Default

Quote:
Originally Posted by SELROC View Post
I got a sense on how to do NIC options manipulation with the "ethtool" program. If ethtool does its job well, it is possible to use an option to manipulate NIC flags, with it I can set the various off-loads to off, and with the rx-fcs option I can switch off crc checking (in theory).


On the other hand I am still searching a C library that lets me read unconditioned ethernet frames.

There are two ethtool options to achieve each of these:


Code:
ethtool -K eth0 rx-fcs on  #1 give us the FCS field

ethtool -K eth0 rx-all on  #2 even receive bad packets
not all NICs can do that, it is quite driver-dependent.
  Reply With Quote
Old 2018-09-24, 11:38   #20
SELROC
 

1,019 Posts
Default

Quote:
Originally Posted by SELROC View Post
There are two ethtool options to achieve each of these:


Code:
ethtool -K eth0 rx-fcs on  #1 give us the FCS field

ethtool -K eth0 rx-all on  #2 even receive bad packets
not all NICs can do that, it is quite driver-dependent.
I forgot to say that the network cable to be used in this experiment has to be dissected and each twisted pair or single wire treated differently via an ad-hoc lab. setup. Currently I am acquiring the necessary material.
  Reply With Quote
Old 2018-09-24, 12:52   #21
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

100110000000112 Posts
Default

Quote:
Originally Posted by SELROC View Post
I forgot to say that the network cable to be used in this experiment has to be dissected and each twisted pair or single wire treated differently via an ad-hoc lab. setup. Currently I am acquiring the necessary material.
Keep at it. This could be a very useful tool!
chalsall is offline   Reply With Quote
Old 2018-10-03, 00:20   #22
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

31·173 Posts
Default

Quote:
Originally Posted by Nick View Post
Runts (i.e. frames shorter than the minimum length), jabbers (frames longer than the maximum length), misaligned frames (number of bits is not a multiple of 8), ....
If you want a runt generator, try what an amateur network admin did on our shared uplink network some years ago; put too many hubs in series between switches or routers, and ordinary equipment at the far end. A media converter counts as half a hub. It helps to have speed mismatches to overload the low speed end.

Late collisions in ordinary traffic in this situation generate runts. (Low budget university networking done by a student not knowledgable about networking or coordinating with people who know what they're doing creates such things. AUI to RJ45 to thin coax to AUI to fiber to stand off lightning potentials between buildings to RJ45 to chained hubs to media converter to old NIC... I think there was a hub or two in there somewhere used as a media converter.)

This was in the bad old days before we had switches with per-port diagnostics. I forget the name of the network monitor used to localize the issue to the smallest network connected to the common uplink, by looking at the content of the abandoned runt packets.

Last fiddled with by kriesel on 2018-10-03 at 00:27
kriesel is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
GPU LLR program jasong GPU Computing 19 2011-08-23 03:32
So you think you can program rogue Lounge 5 2009-10-02 15:02
Program Primeinator Information & Answers 5 2009-07-16 21:42
Program for GPU tribal Information & Answers 5 2009-03-19 20:54
which program? drakkar67 Prime Sierpinski Project 14 2005-11-29 06:25

All times are UTC. The time now is 08:34.


Sat Jul 17 08:34:31 UTC 2021 up 50 days, 6:21, 1 user, load averages: 1.05, 1.41, 1.47

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.