network-protocols

ARP Table entries

I am using following code to retrieve MAC address for an IP address. public string GetMACAddressFromARP(string ipAddress) { IPAddress ipAdd; try { ipAdd = IPAddress.Parse(ipAddress); } catch (Exception ex) { return null; ...

Choice of protocol?

I am designing my own transport protocol for a video conferencing application. I would like to know whether a connection based or connectionless based approach is better for this application. ...

Working with persistent HTTP connections

Hello everyone! We're trying to implement a proxy proof of concept but have encountered an interesting question: since a single HTTP connection can, and indeed should, make mutliple requests, and the HTTP transactions are sent via multiple packets (due to TCP's magic) is it possible for a HTTP request to begin in the middle of a packet?...

Error parsing IP header

Hello, I have a small function that tries to print the fragment offset of an IP header. ParseIpHeader(unsigned char *packet, int len) { struct ethhdr *ethernet_header; struct iphdr *ip_header; /* First Check if the packet contains an IP header using the Ethernet header */ ethern...

TDD on client-server application

Currently I'm creating a server application to receive protocol-specific messages. I need to create tests to ensure that I've implemented the protocol correctly. Is this some kind of integration testing? If positive, can I make an integration testing with unit testing tools? And finally, what is the best way to create these kind of tests...

How to send large data using C# UdpClient?

I'm trying to send a large amount of data (more than 50 MB) using C# UdpClient. So at first I split the data into 65507 byte blocks and send them in a loop. for(int i = 0; i < packetCount; i++) myUdpClient.Send(blocks[i], block[i].Length, remoteEndPoint); My problem is that only the first packets can be received. During sending t...

determine if TCP connection uses SSL

Perhaps some server can handle both non-secure and secure protocols. Is there known way to determine if existing TCP connection secure or not? (I believe it is possible just monitor traffic and check if some text is readable, but maybe there is better or maybe more detailed suggestions?) ...

Call web service over HTTP on HTTPS page

Hello I am having problems calling a web service using AJAX via HTTP when it's on an HTTPS page. Is this a cross-domain/protocol problem? Do I need to do the AJAX call in the same protocol as the page? Just wondering if it's the same problem as trying to do an HTTPS AJAX call when on an HTTP page, I suspect it is. Any advice appreci...

Java: How to use byte literals greater than 0x7F.

In Java, I can't take a byte array of unsigned bytes (from something such as Wire Shark) and put this into java.... Because I will get compile errors since anything greater than 127 decimal/0x07F is treated not as a byte, but as an int.... IE: byte[] protocol = { 0x04, 0x01, 0x00, 0x50, /*error*/0xc1, /*error*/0xdb, 0x1c, /*erro...

length of captured packets more than MTU

Hi, I m running iperf between two machines (linux) and I can observe the mtu of both the interfaces connected is 1500. I ran tcpdump to capture packets and I observed some packets have "length as 2962"....how come this is possible with mtu as only 1500? Please clarify. Thanks! Note: flags field is set as DF. and proto is TCP ...

IPv4 and IPv6 In a Single Network Segment

Hi there. I need someone to back me up, or prove me wrong, in regard to the comments I've made some time ago. Here is the original thread: http://stackoverflow.com/questions/2277536/dual-stack-ipv6-ipv4-on-localhost/2277596#2277596 Basically, I'd like to know if we can have 2 different kinds of IP addresses (IPv4 and IPv6) running on...

Performance of IPX/SPX and TCP/IP

Hi, I understand that IPX and SPX both provide connection services similar to TCP/IP. Here, IPX is similar to IP and SPX is similar to TCP and hence eager to know about this. How does the performance of IPX/SPX exceed that of TCP in LAN ? Why is IPX/SPX not used in LAN alone if its performance is superior to that of TCP in the case of L...

Rationale behind ACKs and SEQs?

I am not sure if people find this obvious but I have two questions: During the 3-way handshake, why is ACK = SEQ + 1 i.e. why am I ACKing for the next byte that I am expecting from the sender? After the handshake, my ACK = SEQ + len. Why is this different from the handshake? Why not just ACK for the next byte I am expecting as well (th...

How to check if its a Router or a Switch? Address in packet from a host in private lan?

I'm in a campus network, Where the network has an hierarchy. We connect to internet using Proxy servers. All our computer IPs are something like 10.*.*.*. 10.1.*.* => Dept 1 (mathematics) 10.1.1.* => 1st floor of this dept. 10.1.1.2 => Default gateway for this floor1 10.1.2.* => 2nd floor of this dept. 10.1.2.2 => Default gateway for...

Socket Protocol Fundamentals

Recently, while reading a Socket Programming HOWTO the following section jumped out at me: But if you plan to reuse your socket for further transfers, you need to realize that there is no "EOT" (End of Transfer) on a socket. I repeat: if a socket send or recv returns after handling 0 bytes, the connection has been broken. If the conn...

gSOAP 2.7.15 Adds a redundant namespace to the message header

Hi, I upgraded my application to use gSOAP 2.7.15 (instead of 2.7.9L). In 2.7.9L I added a code to insert the namespaces to the message header - and it worked fine. In 2.7.15, the namespaces are being inserted automatically but WS-Addressing namespace appears twice!! Any idea?? ...

Do the Nagle Algorith and Delayed ACK's affect TCP Connection Setup?

Do the client's SYN and the servers SYN+ACK get delayed by Nagle? Will the client's ACK of the server's SYN get delayed? Will connect return after rtt+spt or will it take rtt + spt + 2x Nagle Delay? Or more generally, how do the Nagle Algorith and Delayed ACK's affect TCP Connection Setup? ...

tcp application exit will send FIN always?

Hi, When a TCP application exits it will send a FIN packet. Consider a tcp client which get connected to a always listening server(server never exits). if the tcp client is exiting abruptly after few exchange of packets, will it always send a FIN packet to the server? Thx! ...

Routing algorithm

Hello, I'm giving a presentation about computer routing and I want to make a good analogy with a real-world situation. However, I could not find it. Do you have in mind any of the situations like the computer routing. If yes, could you please provide me with it ...

Creating Discoverable Network Resources (.NET)

Is it possible to create a discoverable network resource in .NET? What I would like to acheive is a means of auto discovery for applications that run on a private network. The architecture will be similar to a client / server application, however the server could be any computer on the network. While the client would not be aware of the...