Ethernet communication on Canoe based on MAC address - capl

I connected a micro and a VN5640. I am sending an ethernet msg from my micro with a MAC destination address " 00: 01: 02: 03: 04: 05".
In Canoe I created an eth network and selected "Use MAC address" in the TCP / IP stack section.
As you can see from the photo, the MAC that I have set for the ethernet network is different from 00: 01: 02: 03: 04: 05, so I would expect the message not to arrive, instead the network still receives the message even if the MAC is different. how is this possible?
Also why does the message I receive from the micro in the "Trace" have a DIR = Tx when this is actually received? (it should not be Rx), the same happens for the message in transmission (the second line of the photo in the "trace") shouldn't it result in Tx?
enter image description here
Thanks everyone for the help.

Related

The reason for changable MAC address

To my understanding, the mac address is supposed to be hard wired on the network card. It is also the so called physical address, and it should be unique. But it is allowed to be modified by the OS, say Window 10. So, is it really communicate with other machine by the new MAC address? Or is the old MAC address still existing on a mapping table somewhere? Is there any rule for creating the custom MAC address? Also, if it is changeable, then it is not unique anymore. What is the point for a hard wired MAC address if it is changeable?
Thanks
What is a Mac Address?
The real Mac address of the network card is unique and immutable.
the Mac address is used on the local network to route the packets :
the router/pc will say : "who has 192.168.1.4?"
The pc with this ip will answer "192.168.1.4 has DC:23:F5:B5:FF:31:94"
The PC/Router will send the packet via ARP protocol to the specified Mac address.
Why virtual MAC Address?
The Mac address allow everyone on the network to identify informations like the brand of your network card, and to follow you're connections on the network through the time. Some router will use the ip address to attribute a same ip address to the same device at each connection.
Fact is, on a public network, you prefer to have a fake Mac address in order to be annonymous. Reducing the risk of attack targeting a specific network card brand.
Problems related to MAC Address
if 2 devices (E.g. VMs) have the same Mac address but different IPs, half of the packets will be received by each network card. And on the computer you will see unexpected disconnection/reconnection really often.
another related problem would be an attack by ARP poisoning, which is an attackant saying " < has <mac_attackant>" resulting in packets sent to an attackant instead of the router (man in the middle)
Rules for creating a virtual MAC address
the macchanger tool on Linux allow you to change your Mac address and can be configured to take a complete random Mac address, a random Mac address belonging to a valid manufacturer, or to have a Mac address from the same manufacturer as the real Mac address, or a specific Mac address you can specify. So, except the size of the Mac address there are no specific rules.
(* The MAC and ip i chose are totally random.)

How to detect which network interface received UDP packet using c++ in windows 7?

I have a Windows 7 machine with 3 Ethernet interfaces.
I created a UDP Socket and bound to INADDR_ANY. When the socket receives a broadcast UDP packet, how to know which network interface received the packets?
I need to get IP address corresponding to the network interface also?
Check out Wireshark:
https://www.wireshark.org/
From Wireshark about their product:
"Wireshark is the world's foremost network protocol analyzer. It lets you see what's happening on your network at a microscopic level. It is the de facto (and often de jure) standard across many industries and educational institutions."

How to real time convert Ethernet packet to Wireless packet?

In case of Ethernet header we will have destination Mac address and Source Mac Address.
In case of 802.11 packets there is at minimum three Mac addresses and in some cases 4 Mac addresses.
How is 802.11 packet formed using 802.3 packet? I know that native wifi is doing conversion in case windows. I want to know how it is achieving?
"How is 802.11 packet formed using 802.3 packet?"
The conversion (between 802.3 and 802.11 MAC frames) happens at link layer. The implementation details are platform and driver-dependent.
An example of how these are done in Linux kernel (using soft-MAC 802.11 driver):
http://lxr.free-electrons.com/source/net/wireless/util.c#L412
http://lxr.free-electrons.com/source/net/wireless/util.c#L530

How to allow Windows 7 accept UDP messages from an external device with address "127.0.0.2"?

My firm produces some devices with a network interface. The devices are sent with a IP address = 0.0.0.0. The customers plugs the device on the private net in the field and, by using a tiny app written with VB6, discover it and set the correct IP address.
This working by using UDP messages: the app broadcast a "Who's there?" UDP message, read back the answer(s) containing the MAC address of the device(s), and the the user send another UDP message containing the new IP address for target MAC.
Now, for some unknown reasons, one of these device get its IP address set to 127.0.0.2. The problem is that now the VB app can't find (via UDP) the device anymore, making it impossible to change the IP address to a valid one.
Further analisys revealed than if the app is running on Windows XP it sees the device, but if the app is running on Windows 7 the UDP message does'nt arrive to to the "socket" (while Wireshark can see the answer from the device).
Now, there a solution to allow Win7 to let "pass" an UDP message sent from a 127.0.0.2 external address? If yes, we could avoid to ship around the world a replacement device with a correct IP address and all the trouble of phisically mounting it in the field.
Here's a Wireshark capture of the "question" and the "answer" not "detected" by the VB app:
cap.pcapng
Now, for some unknown reasons, one of these device get its IP address set to 127.0.0.2.
You need to fix that.
The 127/8 block is reserved for the "loopback" address (ie. localhost). No packets sent to 127.0.0.2 will leave your systems NIC. Unless there are bugs in the drives (or hardware): this could be the case with WinXP.

KITL connection issue: WIN EC7

I am using OpenBoard-AM335x from Phytec india and have installed WIN EC7.
My problem is, i can not create a KITL connection between platform builder and my device.
To create a KITL connection i have followed steps as below:
Device side setup:-
started device, opened EBOOT configuration at boot time
selected option '4' for Network settings in EBOOT main menu
set static-ip=192.168.0.182 subnet-mask=255.255.255.0 and router-ip=192.168.0.1(our router ip address, device is connected with LAN cable)
selected Boot from Internal EMAC from boot device menu
PC side setup:-
set ip of PC to 192.168.0.102, subnet-mask=255.255.255.0 and default gateway=192.168.0.1 (pc is connected with wi-fi router)
disabled firewall and anti-virus software
opened Target->Connectivity options in Visual studio 2008
Added device with target device name "AM335X" and Associated OS design with "Windows CE" in Add device menu
set Target device to "AM335X", Kernel Download to "Ethernet", Kernel Transport "Ethernet", Kernel Debugger to "KdStub" in Kernel Service Map menu
opened "settings" of Kernel Download
Now platform builder is waiting for active devices
Next, started device to boot with above described settings, the device starts to send messages "sent BOOTME to 255.255.255.255" to serial console. But, nothing detected by platform builder.
Device's serial log is as follows:
--------------------------------------------------------------------------------
Main Menu
--------------------------------------------------------------------------------
[1] Show Current Settings
[2] Select Boot Device
[3] Select KITL (Debug) Device
[4] Network Settings
[5] SDCard Settings
[6] Set Device ID
[7] Save Settings
[8] Flash Management
[9] Enable/Disable OAL Retail Messages
[a] Select Display Resolution
[b] Select OPP Mode
[0] Exit and Continue
Selection: 1
Main:
Boot device: Internal EMAC
Debug device: Internal EMAC
Retail Msgs: disabled
Device ID: 0
Display Res: 7in LCD_017 (800x480#60Hz)
Flashing NK.bin: disabled
OPP Mode: MPU[720Mhz # 1.26V]
SDCard:
Filename: "nk.bin"
Network:
KITL state: enabled
KITL type: active
KITL mode: interrupt
DHCP: disabled
IP address: 192.168.0.182
IP mask: 255.255.255.0
IP router: 192.168.0.1
Eth MAC Addr : 00:18:31:8d:c6:92 (Boot settings)
Eth MAC Addr 1: 00:18:31:8d:c6:93 (Boot settings)
VMINI: enabled
Note: USBFN RNDIS MAC Addr cannot be changed.
--------------------------------------------------------------------------------
Main Menu
--------------------------------------------------------------------------------
[1] Show Current Settings
[2] Select Boot Device
[3] Select KITL (Debug) Device
[4] Network Settings
[5] SDCard Settings
[6] Set Device ID
[7] Save Settings
[8] Flash Management
[9] Enable/Disable OAL Retail Messages
[a] Select Display Resolution
[b] Select OPP Mode
[0] Exit and Continue
Selection: 0
ShowSDLogo
Init HW: controller RST
SDCARD: requested speed 1000000, actual speed 1000000
SDCARD: requested speed 25000000, actual speed 19200000
BLSDCardReadLogo: cannot open Logo.bmp
+Cpsw3gInit(0x4a100000, 0x00000001, 0x8fefff6c) v0.3
Auto negotitation failed
Phy_init: Auto negotitation completed
Cpsw3gInit, wait link up on mac port:1.
Cpsw3gInit, LINK down on port:1.
INFO: Boot device uses MAC 00:18:31:8d:c6:92
INFO: *** Device Name AM335X-50834 ***
+EbootSendBootmeAndWaitForTftp
Sent BOOTME to 255.255.255.255
Sent BOOTME to 255.255.255.255
Sent BOOTME to 255.255.255.255
Sent BOOTME to 255.255.255.255
Sent BOOTME to 255.255.255.255
Sent BOOTME to 255.255.255.255
Sent BOOTME to 255.255.255.255
Sent BOOTME to 255.255.255.255
Sent BOOTME to 255.255.255.255
Any suggestions/comments ?
Thanks in advance.
Check that you don't have any firewall installed on your machine preventing platform builder from receiving packets from your device. If both machines are on the same IP subnet you should be able to receive broadcast packets. Usually if you have the Windows firewall enabled you will get a message reporting that platform builder is opening a port on your PC and if you don't allow the operation it will not be able to connect.

Resources