Network Coding For Star and Mesh Networks