network-protocols

OS-independent Inter-program communication between Python and C

纵然是瞬间 提交于 2019-12-30 06:35:32
问题 I have very little idea what I'm doing here, I've never done anything like this before, but a friend and I are writing competing chess programs and they need to be able to communicate to each other. He'll be writing mainly in C, the bulk of mine will be in Python, and I can see a few options: Alternately write to a temp file, or successive temp files. As the communication won't be in any way bulky this could work, but seems like an ugly work-around to me, the programs will have to keep

Processing packets with unknown IPv6 extension headers

时间秒杀一切 提交于 2019-12-30 06:24:34
问题 Question Should one discard a packet with an unknown IPv6 extension header? Details I could not find an answer to this question by examining the RFC. The book IPv6 Essentials states on page 22: If a node is required the next header but cannot identify the value in the Next Header field, it is required to discard the packet and send an ICMPv6 Parameter Problem message back to the source of the packet. I read this as: a IPv6 packet with a custom extension header cannot will be dropped unless

Why are TCP messages in my PC coming in frames of 590 bytes

一世执手 提交于 2019-12-25 03:44:40
问题 I am analyzing wireshark log files, when I make a request to a web page using firefox through a proxy server. Following are details of connection establishment: I have noted "maximum segment size" when I open options branch in the TCP segment details of the [SYN] message from my PC to the proxy server - it says 1460 bytes Similarly, maximum segment size eof the [SYN,ACK] message from the proxy server to my PC - it says 1460 bytes After establishing the TCP connection, should not each of the

Client/server - How to separate protocol from network logic?

自闭症网瘾萝莉.ら 提交于 2019-12-24 08:48:16
问题 I want to implement and unit test (not necessarily TDD) a client application which communicates with a TCP server using in a certain application protocol. I've seen in places such as here (1) and here (2) that protocol code should be preferably decoupled from the network code so I each one can be unit-tested separately. However I'm failing to understand how should I design and implement those parts. The first link talks about a MyProtocolHandler class with methods HelloMessage() and

Client server message interpretation

断了今生、忘了曾经 提交于 2019-12-24 05:12:39
问题 I'm trying to communicate data between a server and a client computer using my program. I have very little knowledge of TCP and how it works so I really need some help. So far a message of my own simplistic protocol is defined as follows: int _header_signature; int _offset_a; int _offset_b; int _size_a; int _size_b; wchar_t stuff[_size_a]; wchar_t stuff2[_size_b]; int _footer_signature; This gets serialized onto a buffer and gets send using Winsock's send() method. My goal is to somehow

Client server message interpretation

冷暖自知 提交于 2019-12-24 05:12:07
问题 I'm trying to communicate data between a server and a client computer using my program. I have very little knowledge of TCP and how it works so I really need some help. So far a message of my own simplistic protocol is defined as follows: int _header_signature; int _offset_a; int _offset_b; int _size_a; int _size_b; wchar_t stuff[_size_a]; wchar_t stuff2[_size_b]; int _footer_signature; This gets serialized onto a buffer and gets send using Winsock's send() method. My goal is to somehow

Why does sending an email need multiple mail server hops?

北城以北 提交于 2019-12-23 10:09:49
问题 When I send an email to somebody, (I think) my email is sent to my home server, then the email is sent to target server, then it is finally sent to the people I want to send to. Sometimes, this needs multiple hops, which is the point that confuses me. Why does this need multiple hops? Why can't the email be sent to the target server directly? XMPP doesn't need multiple hops, for example. 回答1: Fundamentally that has to do with the original purpose of the Internet, or rather it's predecessor

Packet Loss and Packet duplication

夙愿已清 提交于 2019-12-23 08:56:14
问题 I am trying to find out what the difference between packet loss and packet duplication problems is. Does anyone know what 'packet duplication' is all about? Is it the same as re-transmitting packets when a loss is detected in TCP? 回答1: No. In TCP delivery of "packets" is reliable(I think the term data should be better in this case, since it's a stream oriented protocol). Packet loss and duplication are problem related to unreliable protocols datagram oriented like UDP . In UDP when you send a

reliable multicast in C#

霸气de小男生 提交于 2019-12-23 05:15:42
问题 what are my options for reliable multicast in c# /.Net 3.5? I don’t want to use MSMQ. I am open to commercial as well as open source options. Thanks 回答1: Take a look at EmCaster 回答2: http://www.29west.com/ claims to be the lowest latency reliable multicast solution available. I have not verified this claim, but in talking to them, it seems that their biggest competition is not some other vendor, but in house developemnt. Why not just set up your own multicast group, and use it directly?

Best Practice: generating and parsing network packets for a known protocol in C#?

左心房为你撑大大i 提交于 2019-12-23 03:55:24
问题 I tried asking a similar question recently however after several answers I realized it wasn't the correct thing to ask. Is there a guide or a generally accepted practice for generating and parsing network packets based on an existing protocol like SMPP (Short Message Peer-to-Peer Protocol [Used for SMS Messages]) or various chat protocols like HOTLINE or IRC with C#. One of the answers mentioned Google Protocol Buffers and a .NET version. After looking at that I realized that serialization is