[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Where do the different frames/datagrams "born"?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 25
Thread images: 1
File: Ethernet-Frame-Explained.png (101 KB, 697x558) Image search: [Google]
Ethernet-Frame-Explained.png
101 KB, 697x558
Let's say i send UDP packets with Packet Sender. (a software which can generated UDP packets)
The software generates the UDP packet.

Where does it gets encapsulated into a IP datagram and then into an Ethernet frame?
>>
>>54457408
The way you asked this question makes my brain hurt. You should open up Wireshark while sending your datagrams, then observe the structure.
>>
>>54457408
>Where does it gets encapsulated

The operating system handles this
>>
>>54457441
I understand the structure of the frames, i just don't know if it it is my network adapter who "makes" the ethernet frames, the software Packet Sender, some drivers or some other stuff?
>>
>>54457445
The top layers (e.g. Layer 7) will be the "parent" of the lower layers in terms of encapsulation

So layer 7 holds layers 4,3,2
Layer 4 will hold layers 3,2
Layer 3 will hold layer 2
Layer 2 has no "parent" encapsulation, because it's the lowest layer in the PDU.

Pretty sure this is right but don't base homework off it. Been a while since I looked at this stuff
>>
>>54457486
Oh that's a good question. I would say Layer 7 (the application Packet Sender) talks to the OS (Layer 6), which then talks to the Network Drivers (Layer 3?), which talk to the Hardware (Layer 1)

I assume Layer 7 creates the initial PDU, then sends it downstream, getting more encapsulated along the way before being sent over the wire.

I assume the Network Drivers are in charge of IP and Ethernet encapsulation, but again I could be wrong.
>>
>>54457408
I will say this because I assume you're a student - don't get too caught up in diagrams & theory. I know you're trying to learn how it works, but unless you're trying to be an electrical engineer for the IETF - you will likely never need to know the depth of information you're asking about.

If you know the structure like you said, and can thoroughly dissect Wireshark output, you'll be good to go with pretty much any networking job.
>>
>>54457608
Basically i want to be able to send an UDP packet from a microcontroller to a PC without using fancy libraries and stuff so i probably have to know how will my finished frame look like.
>>
>>54457408
I'd tell you but you might not get it.
>>
>>54457666
>I want to perform networking without using fancy libraries

Sheesh good luck. I'm guessing you'll be using C or C++? I've never programmed with a microcontroller before. Too bad it's not a Raspberry Pi running Python. The task could be completed in about 5 minutes!
>>
>>54457760
Grow a dick faggot.
>Raspberry Pi running Python
You make me fucking sick.
>>
>>54457788
>I'm sick because someone chose a programming language I don't approve of

Drama queen much?
Look at us, a faggot and a queen.
>>
>>54457810
>Raspberry Pi running Python
So much fucking bloat just to perform one simple fucking task.
>>
>>54457863
Son why are you so angry? You called me a faggot, said I made you fucking sick, and now you've said the word fucking again.

What's got you so bothered in the real world? How's your home life?
>>
>>54457909
>and now you've said the word fucking again.
>OH NO SOMEONE SWORE ON THE INTERNET AHH WHAT DO I DO!
I hope you never ever get hired. The world would crash and burn if faggots like you were in charge of embedded development. Jesus fucking christ.
>>
>>54457408
you can write your own ethernet frame if you want with SOCK_RAW.
>>
>>54457788
>>54457863
>easy to use programming language which comes with the OS base system used to perform an non-CPU-intensive task on a system with 512MB of RAM that will probably not be used as a key component in a specific world where even node.js is getting installed on controllers
>muh bloat

Not everything needs to be written in asm, faggot
>>
>>54458490
static void
close_conn(conn_t * conn, int wait_plain, const char *fmt, ...)
{
va_list ap;
char reason[128]; /* must always be under 250 bytes */
uint8_t buf[256];
int len;
if(IsDead(conn))
return;

rb_rawbuf_flush(conn->modbuf_out, conn->mod_fd);
rb_rawbuf_flush(conn->plainbuf_out, conn->plain_fd);
rb_close(conn->mod_fd);
SetDead(conn);

if(!IsZipSSL(conn))
rb_dlinkDelete(&conn->node, connid_hash(conn->id));

if(!wait_plain || fmt == NULL)
{
rb_close(conn->plain_fd);
rb_dlinkAdd(conn, &conn->node, &dead_list);
return;
}
rb_setselect(conn->plain_fd, RB_SELECT_READ, conn_plain_read_shutdown_cb, conn);
rb_setselect(conn->plain_fd, RB_SELECT_WRITE, NULL, NULL);
va_start(ap, fmt);
vsnprintf(reason, sizeof(reason), fmt, ap);
va_end(ap);
>>
>>54458490
static void
common_zlib_inflate(conn_t * conn, void *buf, size_t len)
{
char outbuf[READBUF_SIZE];
int ret, have = 0;
((zlib_stream_t *) conn->stream)->instream.next_in = buf;
((zlib_stream_t *) conn->stream)->instream.avail_in = len;
((zlib_stream_t *) conn->stream)->instream.next_out = (Bytef *) outbuf;
((zlib_stream_t *) conn->stream)->instream.avail_out = sizeof(outbuf);

while(((zlib_stream_t *) conn->stream)->instream.avail_in)
{
ret = inflate(&((zlib_stream_t *) conn->stream)->instream, Z_NO_FLUSH);
if(ret != Z_OK)
{
if(!strncmp("ERROR ", buf, 6))
{
close_conn(conn, WAIT_PLAIN, "Received uncompressed ERROR");
return;
}
close_conn(conn, WAIT_PLAIN, "Inflate failed: %s", zError(ret));
return;
}
have = sizeof(outbuf) - ((zlib_stream_t *) conn->stream)->instream.avail_out;

if(((zlib_stream_t *) conn->stream)->instream.avail_in)
{
conn_plain_write(conn, outbuf, have);
have = 0;
((zlib_stream_t *) conn->stream)->instream.next_out = (Bytef *) outbuf;
((zlib_stream_t *) conn->stream)->instream.avail_out = sizeof(outbuf);
}
>>
>>54458490
enum {
PRIV_NEEDOPER = 1
};
typedef unsigned int PrivilegeFlags;

struct PrivilegeSet {
unsigned int status; /* If CONF_ILLEGAL, delete when no refs */
int refs;
char *name;
char *privs;
PrivilegeFlags flags;
rb_dlink_node node;
};

int privilegeset_in_set(struct PrivilegeSet *set, const char *priv);
struct PrivilegeSet *privilegeset_set_new(const char *name, const char *privs, PrivilegeFlags flags);
struct PrivilegeSet *privilegeset_extend(struct PrivilegeSet *parent, const char *name, const char *privs, PrivilegeFlags flags);
struct PrivilegeSet *privilegeset_get(const char *name);
struct PrivilegeSet *privilegeset_ref(struct PrivilegeSet *set);
void privilegeset_unref(struct PrivilegeSet *set);
void privilegeset_mark_all_illegal(void);
void privilegeset_delete_all_illegal(void);
void privilegeset_report(struct Client *source_p);
>>
>>54458507
>>54458515
>>54458524
OP is trying to learn how UDP works, not trying to write an IRC server.

>>54457666
>I want to perform networking without using fancy libraries

Google "beej's network guide". That's about as low as you can go w/o writing your own drivers.
>>
>>54458585
That guide seems cool, thanks!
>>
Is it possible to go as deep as defining every single 0 and 1 in an ethernet frame (UDP packet) and then sending that or some hardware/drivers etc. in/on my computer will mess up them anyways?
>>
>>54460764
wireshark
>>
>>54460764
Well you could define all the bits in an ethernet frame header, IP header, and UDP header if you wanted, you'll have to make sure they would make sense to the receiving NIC or else it will reject it. By that I mean the headers will have to have some combination of bits that is recognized as standard.
Thread replies: 25
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.